danielgtaylor / jpeg-archive

Utilities for archiving JPEGs for long term storage.
1.16k stars 122 forks source link

jpeg-recompress - the output file could optionally have the same creation date and time #46

Open GiottoVerducci opened 7 years ago

GiottoVerducci commented 7 years ago

I use the date and time to remember when a picture was taken, it would be great if that that date/time was transferred to the new file as an option of jpeg-recompress.

javabean commented 7 years ago

You will get that behavior by using my own wrapper script: see #39 or https://gist.github.com/javabean/9ef827ea82268c1a9868ec617de3a1d8 :-)

Yoshiyuki-Ogawa commented 7 years ago

Prologue

I know this is a wrong place to post my batch files, but searching the internet like:allintitle: file "same creation date" - Google Search, I found only this site. So, let me introduce and post my batch files here, with which I make "clone files". By "clone files" I mean the creation date of files are kept while copying.

They are:

  1. bak_0_P2_addTFolderNamemovecopyback_en.bat
  2. bak_0_P2_addTmovecopyback_en.bat
  3. bak_0_P2_movecopyback_WOUI.bat

For the modification of the clone file with the path of the target file, it may be necessary that your Windows OS is Unicode compatible.

Additionally, let me introduce and post another batch file: bak_0_P2_addTren_WOUI_en.bat

The bak_0_P2_addTren_WOUI_en.bat batch file can be used to modify a file with the time stamp of the file, without making a clone file.

Just for your information:

It was necessary to change the Slash path separator "/" character in the date and time strings, to some other character allowed within filenames.

So, I used the trick in the batch file, as shown below:

set T=%~t1 set T=%T:/=-% set T=%T:~0,15%

However, the trick above is not necessary if you have changed the "/" character in the date and time strings to some other string which can be used within filenames.

To that end, you have to tweak the settings by using Regional and Language Options in Control Panel (intl.cpl), however, let me introduce and post registry files which will do the job in a flash:

On Windows 2000 and later, use the following .REG files. These are Unicode-based:

  1. RegFromApp_v133-x64_RegFileVersion_5_rundll32_sShortDate=yyyy-MM-dd_sDate=-_original.reg
  2. RegFromApp_v133-x64_RegFileVersion_5_rundll32_sShortDate=yyyy/MM/dd_sDate=/_modified.reg

Use the "RegFromApp_v133-x64_RegFileVersion_5_rundll32_sShortDate=yyyy-MM-dd_sDate=-_original.reg" .REG file to change the "/" character in the date and time strings to "-" (hyphen), which is allowed to be used within filenames.

Conversely, if you want to revert the change made by the .REG file above, use the "RegFromApp_v133-x64_RegFileVersion_5_rundll32_sShortDate=yyyy/MM/dd_sDate=/_modified.reg" .REG file.

On Windows 9x and NT 4.0 systems, use the following .REG files.

These are ANSI-based:

  1. rundll32_sShortDate=yyyy/MM/dd_sDate=-_original_RegFromApp_v133-x64_RegFileVersion_4.reg
  2. rundll32_sShortDate=yyyy-MM-dd_sDate=/_modified_RegFromApp_v133-x64_RegFileVersion_4.reg

Use the "rundll32_sShortDate=yyyy/MM/dd_sDate=-_original_RegFromApp_v133-x64_RegFileVersion_4.reg" .REG file to change the "/" character in the date and time strings to "-" (hyphen), which is allowed to be used within filenames.

Conversely, if you want to revert the change made by the .REG file above, use the "rundll32_sShortDate=yyyy-MM-dd_sDate=/_modified_RegFromApp_v133-x64_RegFileVersion_4.reg" .REG file.

If you wouldn't like to download these files for fear of virus contamination, I can post these files as plain text files for you to copy and paste to make them for yourselves.

You can ask me to do so by contacting me via:

  1. Email: galileoogalilei@aol.com

  2. Or you can ask me verbally by placing a call to Yoshiyuki Ogawa, to my cell phone as follows:

  3. Find your country’s international exit code. To place an international phone call, you will need to dial your country’s exit code--the number that tells your phone service that you will be calling outside the country. If you were to place an international call from the United States, your exit code would be 011, while if calling from Argentina, you would dial 00 to call internationally.[1]

  4. To find out what your country’s exit code is, simply run a search on your favorite internet search engine. Type in a phrase like “[The name of your country] exit code.”

  5. Find out what the code is of the country you are trying to reach. In this case, the country is Japan. Japan’s country code is 81.[2]

You would dial:

However, please be reminded that my varbal comunication is no better than that of a kindergartener.

You can see how I felt bad for my poor (verbal) English in my Facebook page: https://www.facebook.com/yoshiyuki.ogawa.507

Please go far down to the bottom of the page, date:August 26, 2014

Though, I passed the 1st grade in English Technical Writing Test held by JAPAN SOCIETY FOR TECHNICAL COMMUNICATION, almost fourty years ago!

The definition for "Technical Writing(in English)" or "Technical Communication(in English)" is:

"Technical Writing may be defined as the presentation in written form of technical and scientific information with clarity and precision on a level suitable to the intended audience."

Feedback

These files may be a bit rough around the edges;so―

If you have any problem, suggestion, comment, or you found a bug in my utility, you can send a message to: galileoogalilei@aol.com

All the best!!

Yoshiyuki Ogawa

Yoshiyuki-Ogawa commented 7 years ago

I tried to upload the files above, to no avail. The .bat files and the .reg files can't be uploaded.

Yoshiyuki Ogawa

galileoOgalilei@aol.com

Yoshiyuki-Ogawa commented 7 years ago

Please see also the: "macos - Batch copy time creation and modification date from files using OSX - Ask Different.html" (http://apple.stackexchange.com/questions/244113/batch-copy-time-creation-and-modification-date-from-files-using-osx/269412#269412)

Yoshiyuki Ogawa

galileoOgalilei@aol.com

javabean commented 7 years ago

@Yoshiyuki-Ogawa,

You can post your files as GitHub Gists, like I have done for UNIX-based OSes (see my 1st comment).
As for copying file attributes (including file times) on Mac OS, see my gist ("darwin").

Yoshiyuki-Ogawa commented 7 years ago

@javabean

You can post your files as GitHub Gists, like I have done for UNIX-based OSes (see my 1st comment).>

Can't make out what you mean by the above sentence.

I do not know where to look for the information you have given in the sentence above.

Seems it concerns "Gists" thing.

I am working on it now.

However, for the time being, I think I'll try a workaround as follows:

As an workaround, I will temporarily change the extensions of the .bat files and the .reg files to .txt, respectively.

After successfully downloading these files, rechange the .txt file extensions to their original ones, respectively.

RegFromApp_v133-x64_RegFileVersion_5_rundll32_sShortDate=yyyy-MM-dd_sDate=-_original.txt

RegFromApp_v133-x64_RegFileVersion_5_rundll32_sShortDate=yyyy/MM/dd_sDate=/_modified.txt

rundll32_sShortDate=yyyy/MM/dd_sDate=-_original_RegFromApp_v133-x64_RegFileVersion_4.txt

rundll32_sShortDate=yyyy-MM-dd_sDate=/_modified_RegFromApp_v133-x64_RegFileVersion_4.txt

bak_0_P2_addTFolderNamemovecopyback_en.txt

bak_0_P2_addTmovecopyback_en.txt

bak_0_P2_movecopyback_WOUI.txt

javabean commented 7 years ago

@Yoshiyuki-Ogawa when logged in to GitHub, go to https://gist.github.com and you can copy-paste text files for public view.

c33s commented 5 years ago

preserving the orginal filedate would really be important.