After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 684662 - Default filename for screenshots is problematic
Default filename for screenshots is problematic
Status: RESOLVED DUPLICATE of bug 698740
Product: gnome-screenshot
Classification: Core
Component: general
3.4.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-screenshot-maint
gnome-screenshot-maint
Depends on:
Blocks:
 
 
Reported: 2012-09-23 14:48 UTC by Alan Pope
Modified: 2014-04-28 14:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Avoid using colons in screenshot file names. (394 bytes, text/plain)
2013-11-05 15:38 UTC, Romano Giannetti
Details

Description Alan Pope 2012-09-23 14:48:03 UTC
Originally filed in Launchpad against the Ubuntu package, filing upstream.

Press "printscreen" and you'll get a default filename of:-

"Screenshot from YYYY-MM-DD HH:MM:SS.png"

Fine for browsing in nautilus and double clicking on, but this format (specifically the colons) has been a bane for me for some time.

1.
Tab completion fails:-
-rw-rw-r-- 1 alan alan 751K Sep 23 01:10 Screenshot from 2012-09-23 01:10:33.png

# tab completion works as far as here
alan@deep-thought:~/Pictures$ scp Screenshot\ from\ 2012-09-2
Screenshot\ from\ 2012-09-21\ 19\:40\:46.png
Screenshot\ from\ 2012-09-23\ 01\:01\:41.png
Screenshot\ from\ 2012-09-23\ 01\:10\:33.png

# get to here and it won't finish the filename off.
alan@deep-thought:~/Pictures$ scp Screenshot\ from\ 2012-09-23\ 01\:

2. scp fails.
alan@deep-thought:~/Pictures$ scp Screenshot\ from\ 2012-09-23\ 01\:10\:33.png popey.com:
ssh: Could not resolve hostname Screenshot from 2012-09-23 01: Name or service not known

3. Ubuntu one file link in thunderbird fails
See bug https://bugs.launchpad.net/ubuntu/+source/thunderbird/+bug/1054803

Whilst I can see an argument for fixing the bugs in all those other applications, wouldn't it make more sense to just not have mad filenames created in the first place.

I propose:-

"Screenshot_from_YYYY-MM-DD_HH-MM-SS.png"
Comment 1 Martin Erik Werner 2013-03-04 14:19:22 UTC
Another issue with using ":" is that this is a disallowed character on windows, so sharing screenshots over to those systems causes issues.
Comment 2 Rodrigo Silva 2013-04-04 03:40:18 UTC
IMHO, spaces are fine, any non-broken software will deal with them nicely, and it can be escaped or quoted just fine.

The *real* problem are the colons: not only they confuse scp/ssh, but they are an *illegal* character on NTFS under Windows.

So my suggestion is:

"Screenshot from YYYY-MM-DD HH-MM-SS.png"

And since anyone will have their own suggestion, besides changing the default please provide a way for each user to choose its own filename format, like Shutter does. If not via GUI, at least via gconf/dconf.
Comment 3 Karl Olson 2013-04-10 23:01:23 UTC
OS X uses '.' instead of ':'. For example:

  Screen Shot 2013-02-09 at 2.14.44 PM.png
Comment 4 Bram Mertens 2013-09-01 09:53:15 UTC
Even though spaces can be handled they are still inconvenient in many cases.  So personally I would like to be able to get rid of those as well.

For what it's worth my proposal is "Screenshot_YYYYMMDD_HHMMSS.png" to keep the name relatively short.

Would it be possible to make the name configurable?
Comment 5 Romano Giannetti 2013-11-05 15:38:51 UTC
Created attachment 259021 [details]
Avoid using colons in screenshot file names.

WARNING: not tested, I am on a windows machine right now :-)
Comment 6 Romano Giannetti 2013-11-05 15:39:24 UTC
Found the upstream bug after posting things to the launchpad bug (sorry for the noise). 

If I read well the source code, while the messages is localized (see just below when the "Screenshot from" text is added), the date-time format is not.

Clearly the best solution would be to make it user-definable (am I hearing the screams of Gnome designers?) but nevertheless I think that the default should be sensible --- and that means generating files that are Windows-compatibles.

So for example I propose this minimalist patch: 

--- /root/src/screenshot-filename-builder.c.orig	Tue Nov  5 08:15:09 2013
+++ /root/src/screenshot-filename-builder.c	Tue Nov  5 08:17:18 2013
@@ -132,7 +132,7 @@
       GDateTime *d;
 
       d = g_date_time_new_now_local ();
-      origin = g_date_time_format (d, "%Y-%m-%d %H:%M:%S");
+      origin = g_date_time_format (d, "%Y-%m-%d %H-%M-%S");
       g_date_time_unref (d);
     }
   else

which just get rid of the colons, do not touch the translation strings, put just one dot in the filename before the file type, and makes everyone half-happy :-) 

WARNING: not tested, I am on a windows machine right now :-), trying to solve the mystery of the screenshots files not mirrored by Dropbox...
Comment 7 haz2a 2014-01-31 10:33:52 UTC
Confirm I have the same issues as the OP with gnome-screenshot 3.4.1-0ubuntu1.1 in Ubuntu 12.04 LTS.
I second the request for a better default format eg: replacing the colons with dots or dashes as suggested by others. User definable would be even better, but a windows-compatible default is essential.
Comment 8 André Klapper 2014-04-15 07:42:17 UTC

*** This bug has been marked as a duplicate of bug 698740 ***
Comment 9 Rodrigo Silva 2014-04-28 14:32:51 UTC
Weird that *this* bug was marked as duplicate, and not the other way around.