! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Spaces, date and time in file names
Status:
RESOLVED: FIXED
Severity:
enhancement
Product:
Xfce4-screenshooter
Component:
General

Comments

Description bdheeman 2012-02-11 18:46:52 CET
1) The spaces in file names had been and are a major problem in most of the native and, or Unix/Non-Unix file-systems, could be a hurdle in sharing, copying and, or moving the screenshot files to other systems.

2) The idea of using colons (:) in file names as also as bad as as is spaces.

3) It is better we use date +%Y%m%dT%H%M%S format for date and time; this will also help us view or list the files in date/time order on almost all systems.
Comment 1 Jérôme Guelfucci editbugs 2012-02-19 15:33:18 CET
I agree that it might make it hard to share the files, particularly ":" which seems to be unsupported on a lot of platforms.

On the other hand, your suggestion makes time stamps totally unreadable and defeat the main purpose of adding the time stamp to the file name. I'm still undecided on this, suggestions welcome.

Re spaces in filenames I don't mind removing them but again I find it a pity to make things harder to read for everyone just to support obsolete file systems.
Comment 2 bdheeman 2012-02-19 21:53:14 CET
If I'm not wrong programmers had been using date/time in the order I suggested to get access/sort the list of file names in a chronological order .i.e. YYYY-MM-DD_HHmmSS.

How about using/adding hyphens (-) and, or underscores (_) e.g. Screenshot_YYYY-MM-DD_HHmmSS.png ?
Comment 3 Liv 2012-08-25 19:08:54 CEST
I would like to add my voice to removing ':' from proposed file names. At least when uploading an attachment to Gmail, the original name is trimmed from Screenshot - 08252012 - 06:12:02 PM.png to the not very helpful 02 PM.png. 

And I agree with Jérôme that the originally proposed +%Y%m%dT%H%M%S is unreadable. How about the following: Screenshot_%Y-%m-%d_%H%M%S ? (Essentially what the OP subsequently suggested.)

This looks readable enough to me and allows for proper sorting of files. All in all, more useful. What do you think?
Comment 4 bdheeman 2012-08-30 14:59:57 CEST
(In reply to comment #3)
> I would like to add my voice to removing ':' from proposed file names. At
> least when uploading an attachment to Gmail, the original name is trimmed
> from Screenshot - 08252012 - 06:12:02 PM.png to the not very helpful 02
> PM.png. 
> 
> And I agree with Jérôme that the originally proposed +%Y%m%dT%H%M%S is
> unreadable. How about the following: Screenshot_%Y-%m-%d_%H%M%S ?
> (Essentially what the OP subsequently suggested.)
> 
> This looks readable enough to me and allows for proper sorting of files. All
> in all, more useful. What do you think?

I think, it's better we make it a configurable option and leave it to the user whatever format she/he likes; for example see the Orage Clock Preferences.
Comment 5 mainhack 2013-06-27 16:10:28 CEST
Anything new to this topic? Everytime I want to copy screenshots to my pen drive I get an error message because of those colons. I would totally appreciate the possibility of customizing the filename pattern in general (my personal choice is YYYY-MM-DD__HH-MM-SS).

--
Despite: Thank you all for your efforts!
Comment 6 Jeff Shipley 2013-07-30 06:10:53 CEST
Created attachment 5112 
Use file-friendly timestamp

The new screenshooter_get_datetime function (added in this patch) would make it easy to create a setting for a custom timestamp.

This patch sets the timestamp to "%Y-%m-%d_%H%M%S" (YYYY-MM-DD_HHMMSS).
Comment 7 wkrekik 2013-09-10 13:21:56 CEST
Very very annoying bug. Please fix it for those who don't know how to patch a soft
Comment 8 Landry Breuil editbugs 2014-12-16 21:52:53 CET
As an example, scrot (another well-known cmdline screenshooter) uses by default this naming scheme: 2014-12-16-214532_2832x1050_scrot.png

So more or less YYYY-MM-DD-HHMMSS_widthxheight_scrot.png. Fwiw, i support the patch in attachment 5112 , which (in conjunction with timestamp=false in the config file) allows for better naming. And this would also fix bug 10348.

I''m not sure we want to make this configurable though (or maybe only as a pref in the config file, only allowing strftime format ?), just better defaults for everyone.

Oh, and spaces in filenames should be forbidden too, but that's only my personal opinion :)

Jerome, any thoughts ?
Comment 9 Landry Breuil editbugs 2014-12-16 21:53:56 CET
*** Bug 10348 has been marked as a duplicate of this bug. ***
Comment 10 Landry Breuil editbugs 2014-12-20 11:10:31 CET
Pushed attachment 5112  hand-merged to git master in ed5f894

Time format currently not configurable and 'hardcoded' to "%Y-%m-%d_%H-%M-%S", apparently that's more or less the consensus. You still get the locale-dependent prefix, so in french i'd get "Capture d'écran_2014-12-20_11-10-12.png" with a space...

And this has the nice effect to fix 10348, no more ':' !
Comment 11 Liv 2014-12-20 11:36:56 CET
Yay! I'm not sure that in some locales having a " ' " as part of the filename is a good idea (e.g. "Capture d'écran_2014-12-20_11-10-12.png"), but let's leave this for a separate bug report. 

Should we expect a release soon enough?
Comment 12 Landry Breuil editbugs 2014-12-20 12:18:51 CET
yes, that's my plan.
Comment 13 Landry Breuil editbugs 2014-12-25 00:16:27 CET
A sidenote to the ones who dont like the default localised filename.. if you set the title config key to "foo" and the timestamp config key to "false" in .config/xfce4/xfce4-screenshooter , the default filename will be foo.png.... so the option to control the default filename (and with or without timestamp) is already here.
Comment 14 Landry Breuil editbugs 2015-11-01 10:07:01 CET
*** Bug 11820 has been marked as a duplicate of this bug. ***

Bug #8445

Reported by:
bdheeman
Reported on: 2012-02-11
Last modified on: 2015-11-01
Duplicates (2):
  • 10348 Saving the screenshot into fat32 file system crashes xfce4-screenshooter due to : in the file name
  • 11820 The generated filename becomes illegal for Windows users when being a Swede.

People

Assignee:
Jérôme Guelfucci
CC List:
7 users

Version

Version:
unspecified

Attachments

Use file-friendly timestamp (5.79 KB, patch)
2013-07-30 06:10 CEST , Jeff Shipley
no flags

Additional information