Bug 258431 - "Send To" options fail because they try to use the proposed (unexistent) file name
Summary: "Send To" options fail because they try to use the proposed (unexistent) file...
Status: RESOLVED FIXED
Alias: None
Product: ksnapshot
Classification: Unclassified
Component: general (show other bugs)
Version: 0.7.1
Platform: openSUSE RPMs Linux
: NOR normal with 115 votes (vote)
Target Milestone: ---
Assignee: Richard Moore
URL:
Keywords:
: 237353 240051 259466 268712 270310 274536 280947 282708 317552 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-11-30 21:27 UTC by jos poortvliet
Modified: 2016-04-19 17:55 UTC (History)
18 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Sets new snapshots to modified so it is saved temporarily. (511 bytes, patch)
2011-02-17 02:32 UTC, styx
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jos poortvliet 2010-11-30 21:27:20 UTC
Version:           0.7.1 (using KDE 4.5.80) 
OS:                Linux

First of all, awesome work on the ksnapshot UI. Much better ;-)

I can imagine the average user missing a big 'close' button but considering that eg ESC and the window close button both work just fine there is imho no issue.

So the problem. Simple. hit prtscrn and choose "send to". The apps don't work (gwenview tells me it can't find the image).

The KIPI export plugins (i guess that's what it is isn't it?) seem to have the same issue - I only tried the "export to HTML one" (quite awesome btw, altough not exactly relevant for 1 picture) but it also didn't show any actual picture.

Even after saving the file it doesn't work - save as 'test.png', then observe Gwenview telling you it can't open 'test1.png'.

Reproducible: Always

Steps to Reproduce:
Hit Prt Sc key. Click "Send to". Choose random menu option and observe failure.

Actual Results:  
failure (app or service can't find picture)

Expected Results:  
success (app or service displays/submits/works with picture)

OS: Linux (x86_64) release 2.6.37-rc3-git6-9-desktop
Compiler: gcc
Comment 1 Dario Andres 2010-12-10 20:28:03 UTC
[Comment from a bug triager]
I can confirm this bug on KDE SC 4.6 beta2 on ArchLinux (but it works properly on KDE SC 4.5.4)
Comment 2 Dario Andres 2010-12-10 20:28:37 UTC
*** Bug 259466 has been marked as a duplicate of this bug. ***
Comment 3 JanKusanagi 2010-12-10 20:40:34 UTC
I can reproduce it in 4.6b2 under Archlinux, and 4.5.2 under Mandriva.
Comment 4 Alexey Shildyakov 2010-12-11 13:38:28 UTC
Think the duplicate of bug 240051
Comment 5 Dario Andres 2010-12-11 14:17:33 UTC
[Comment from a bug triager]
In fact, it is very related but I don't know if the behaviour is exactly the same.
Just checked again with KDE SC 4.6beta1
1) KSnapshot starts, first screenshot is taken, Send To menu options doesn't work
2) A second screenshots is taken, the Send To menu options work!
3) The second screenshot is saved to a file, the proposed filename in the KSnapshot window titlebar changes again, the Send To menu options doesn't work ...
(I don't know if bug 240051 included this cases as well...)

Regards
Comment 6 Thomas Tanghus 2010-12-26 11:07:10 UTC
Confirmed on Kubuntu 10.10 KDE SC 4.5.90 (4.6 RC1).

If you take a snapshot you can share it on facebook _if you don't save it first_
Otherwise KSnapshot increments the numbering of the filename which points to a non-existing file.

Besides that: Great UI and potentially great sharing possibility.
Comment 7 Pau Garcia i Quiles 2010-12-26 16:18:27 UTC
See this thread for my acknoledgement of the problem, a possible fix, and rejection of the fix by one of the maintainers of KSnapshot:

http://thread.gmane.org/gmane.comp.kde.devel.graphics/119
Comment 8 Thomas Tanghus 2010-12-26 18:51:43 UTC
(In reply to comment #7)
> See this thread for my acknoledgement of the problem, a possible fix, and
> rejection of the fix by one of the maintainers of KSnapshot:
> 
> http://thread.gmane.org/gmane.comp.kde.devel.graphics/119

That was long ;-)

My 0.02 €:

- When starting KSnapshot it should take a snapshot, create a tempory file under /tmp, show "New Snapshot" or something in the title bar. KSnapshot could/should delete any unused temporary files on exit.

- When the user clicks "Save As..." it should suggest the last used name incremented by 1.

- When the user chooses to "Send to" a different program or plugin it should be passed the temporary file. I don't know if there's a way to notify the opening application that it's a temporary file, but I see it as the responsibility of the external application - not KSnapshot - to determine the action taken when saving the image. At least on Linux/*nix it's just checking whether it's under /tmp and then suggest another location.
Comment 9 jos poortvliet 2010-12-28 19:56:28 UTC
@Pau
While that thread did end up with something usable (the [modified] behind the filename instead of showing unsaved should solve the issue there) one of the things you mentioned, the issue we talk about here (send to not working) was not discussed. Because Aaron got carried away with the other item. Looks like he had a bad day there ;-)

I think you mentioned 2 different issues and only 1 of them got addressed. Nobody responded to your first issue:
 - The behavior when you open KSnapshot (a snapshot is taken but it's
not available to Send To... actions)
(eg this bug)

I hope Aaron can look at that at least ;-)
Comment 10 Pau Garcia i Quiles 2010-12-29 00:48:49 UTC
@Jos

Send to... does not work because the first snapshot taken when you start KSnapshot is not saved. 

I have seen an even trickier consequence of the (IMHO, wrong) saving workflow KSnapshot currently uses: you take a snapshot, but when you do Send to..., the file which is used (opened) is actually the snapshot *before* the last one.
Comment 11 Pau Garcia i Quiles 2010-12-29 01:07:54 UTC
I'm currently busy with Christmas and porting KSnapshot to Windows. If noone has provided a solution when I'm done with that (in a week or so), I'll work on a solution to the root cause of this bug. 

It'll be a variation of what I proposed in the thread I linked above. I think this variation would be acceptable to Aaron because it will unconditionally save the file to the last-used directory (no guessing of temporary vs definitive) and won't automatically show a dialog.

IIRC there are more bugs against KSnapshot which are caused by the saving flow.
Comment 12 styx 2011-02-17 02:32:35 UTC
Created attachment 57319 [details]
Sets new snapshots to modified so it is saved temporarily.
Comment 13 styx 2011-02-17 02:33:13 UTC
One line to rule them all :D
Comment 14 styx 2011-02-17 02:34:15 UTC
I added a Patch to fix this.
Comment 15 jos poortvliet 2011-03-05 20:10:19 UTC
This bug has been fixed in KSnapshot 0.8.2 (part of KDE Applications 4.6.0 or is this part of workspace?)
Comment 16 Pau Garcia i Quiles 2011-03-08 18:52:10 UTC
(In reply to comment #14)
> I added a Patch to fix this.

You patch only fixes this bug for the first time.

Steps to reproduce after applying your patch:

1. Open KSnapshot
2. Send to -> KolourPaint. Screenshot is there. Great!
3. Close KolourPaint, go back to KSnapshot
4. Save As...
5. Take new snapshot
6. Send to -> KolourPaint.

Expected: screenshot is in KolourPaint

Actual result: KolourPaint shows a white rectangle

I have applied your patch because it's better than nothing, but it's not THE fix.

(Sorry for taking so long to answer, I have been very busy lately)

Jos: not, this is not fixed yet. I don't know why this bug was marked as FIXED.
Comment 17 Pau Garcia i Quiles 2011-03-08 18:53:39 UTC
(In reply to comment #14)
> I added a Patch to fix this.

You patch only fixes this bug for the first time.

Steps to reproduce after applying your patch:

1. Open KSnapshot
2. Send to -> KolourPaint. Screenshot is there. Great!
3. Close KolourPaint, go back to KSnapshot
4. Save As...
5. Take new snapshot
6. Send to -> KolourPaint.

Expected: screenshot is in KolourPaint

Actual result: KolourPaint shows a white rectangle

I have applied your patch because it's better than nothing, but it's not THE fix.

(Sorry for taking so long to answer, I have been very busy lately)

Jos: not, this is not fixed yet. I don't know why this bug was marked as FIXED.
Comment 18 Pau Garcia i Quiles 2011-03-11 15:06:04 UTC
Debian bug #617793 might be related

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=617793
Comment 19 Christoph Feck 2011-05-30 22:39:33 UTC
*** Bug 274536 has been marked as a duplicate of this bug. ***
Comment 20 Christoph Feck 2011-09-24 20:29:04 UTC
*** Bug 282708 has been marked as a duplicate of this bug. ***
Comment 21 jos poortvliet 2011-12-13 00:02:17 UTC
Unfortunately I can still reproduce this on Plasma Workspace 4.7.3 (KSnapshot 0.8.2).
Comment 22 Maarten De Meyer 2013-05-07 17:49:18 UTC
*** Bug 317552 has been marked as a duplicate of this bug. ***
Comment 23 Maarten De Meyer 2013-05-07 17:50:02 UTC
*** Bug 240051 has been marked as a duplicate of this bug. ***
Comment 24 Maarten De Meyer 2013-05-07 17:51:30 UTC
*** Bug 268712 has been marked as a duplicate of this bug. ***
Comment 25 Maarten De Meyer 2013-05-07 17:51:43 UTC
*** Bug 270310 has been marked as a duplicate of this bug. ***
Comment 26 Maarten De Meyer 2013-05-07 17:52:12 UTC
*** Bug 237353 has been marked as a duplicate of this bug. ***
Comment 27 Maarten De Meyer 2013-05-07 17:53:48 UTC
*** Bug 280947 has been marked as a duplicate of this bug. ***
Comment 28 Thomas Tanghus 2014-07-31 01:02:02 UTC
Kudos to whoever reopened this issue!
Comment 29 Janet 2014-08-01 11:35:07 UTC
Still valid in KDE SC 4.13.4. - increasing the file numbering only should take place after a new screenshot is taken, not after a file is saved.
Comment 30 Aaron J. Seigo 2014-09-15 08:42:43 UTC
Git commit 1e367462a06b3a1a5952554d7706e740d008156e by Aaron Seigo.
Committed on 15/09/2014 at 08:41.
Pushed by aseigo into branch 'frameworks'.

send the last saved snapshot, otherwise save our shot to a temp file

M  +2    -2    ksnapshot.cpp

http://commits.kde.org/ksnapshot/1e367462a06b3a1a5952554d7706e740d008156e
Comment 31 Elias Probst 2014-11-09 05:04:09 UTC
I can still reproduce this in 'frameworks' although the changes from comment#30 seem to be applied there in ksnapshot.cpp.

→ Open ksnapshot
→ Create a new snapshot
→ Send To…
→ Gwenview

- Loading 'snapshot_TJ9858.png' failed
- Could not open file /home/elias/snapshot_TJ9858.png

The mentioned file doesn't exist in my FS, neither in the mentioned path, nor in /tmp or other possible QDir::tempPath() (used by QTemporaryFile).

Using Qt 5.4.0 beta and ksnapshot 9cce9db7
Comment 32 jos poortvliet 2016-04-19 17:55:24 UTC
With our new screenshot app this is no longer an issue, so - close.