merbin2012 / sharex

Automatically exported from code.google.com/p/sharex
0 stars 1 forks source link

Long window name will overwrite existing screenshots files taken on the same day #556

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Define a name pattern for active window capture including the window text 
(e.g. "%t_%y-%mo-%d_%h-%mi-%s-%i")
2. Take a screenshot of a window with a long name (e.g. 
"PDF_Reader_-_Vertriebscontrolling__So_steuern_Sie_Absatz,_Umsatz_und_Gewinn_-_G
oogle_Chrome")
3. The file is saved correctly.
4. Take another screenshot of a window with a long name (e.g. 
"PDF_Reader_-_Vertriebscontrolling__So_steuern_Sie_Absatz,_Umsatz_und_Gewinn_-_G
oogle_Chrome")

What is the expected output? What do you see instead?
I expect to see two files in the screenshot folder (one for step 2 and one for 
step 4).
But I do only see one file instead (the one from step 4).
The resulting filename is 
"PDF_Reader_-_Vertriebscontrolling__So_steuern_Sie_Absatz,_Umsatz_und_Gewinn_-_G
oogle_Chrome_2014-01-.png", which shows that it was truncated after the current 
month, excluding the hour/minue/seconds timestamp.
In consequence both filenames are identical and the file from step 2 gets 
overwritten by the second screenshot on the same day.

What version of the product are you using? On what operating system?
ShareX version 8.4.1 on Windows 7 SP1 x64 German.

Please provide any additional information below.

A possible workaround would be to just use the window title and an auto 
increment number instead of the date. Or I could put the date in front of the 
window title, but thiswould not allow me to sort the files by window title 
anymore.

Nevertheless I would appreciate to be able to limit the window title to a 
reasonable number of characters as it should come first in the filename.
So please provide an option for this in the name pattern dialog.

Original issue reported on code.google.com by Sebastia...@gmail.com on 7 Jan 2014 at 6:54

GoogleCodeExporter commented 9 years ago
I think need to change name formatting system to support parameters like this:

%Title(160) = Max 160 characters limit
%RandomAlphanumeric(10) = Random 10 alphanumeric characters
%Month(2) = 01 instead 1
%Counter(4) = 0001 instead 1

but it is too late to implement this because of backward compatibility :(
Also automatic commands menu can be problematic.

Original comment by flexy...@gmail.com on 7 Jan 2014 at 10:29

GoogleCodeExporter commented 9 years ago
Maybe that could be an extension like
%Title{160}
using curly braces as they might be more unusual in terms of usage in a 
filename.

Or if you really are scared about breaking existing stuff (which is 
reasonable), you could also introduce a flag like "extended filename 
placeholders", which enables parsing extensions like length of the result.

Original comment by Sebastia...@gmail.com on 8 Jan 2014 at 6:22

GoogleCodeExporter commented 9 years ago
Problem is this menu 
https://dl.dropbox.com/u/14076298/ShareX/2014/01/6TDTxnXuiP.png
It is automatically created from enum. And don't have any space for new 
variables with parameters and i can't automate them.

Original comment by flexy...@gmail.com on 8 Jan 2014 at 8:48

GoogleCodeExporter commented 9 years ago
I better add max title length, it is more easy to implement.

Original comment by flexy...@gmail.com on 13 Jan 2014 at 6:05

GoogleCodeExporter commented 9 years ago
In your filename, %d_%h-%mi-%s-%i is missing.

Filename never should have been:
PDF_Reader_-_Vertriebscontrolling__So_steuern_Sie_Absatz,_Umsatz_und_Gewinn_-_Go
ogle_Chrome_2014-01-.png

It should have been: 
PDF_Reader_-_Vertriebscontrolling__So_steuern_Sie_Absatz,_Umsatz_und_Gewinn_-__2
014-01-07-12-59-59-1.png

The total length should be no more than 100 chars. So whatever is extra should 
be reduced from Title. It appears that currently it is simply getting truncated 
from the end, rather than from the title. 

Original comment by mcored on 13 Jan 2014 at 6:18

GoogleCodeExporter commented 9 years ago
https://dl.dropbox.com/u/14076298/ShareX/2014/01/ShareX_-_Task_settings.png

Original comment by flexy...@gmail.com on 13 Jan 2014 at 6:38

GoogleCodeExporter commented 9 years ago
Yes exactly, that was my first thought.
If it needs to be truncated, do it on the title.
Then the date should make the filename unique enough to not overwrite any 
previous screenshots of the same window.

Original comment by Sebastia...@gmail.com on 13 Jan 2014 at 6:56