Author Topic: saving JPEG trailers  (Read 559 times)

Jaff

  • Newbie
  • *
  • Posts: 7
saving JPEG trailers
« on: February 05, 2020, 10:59:50 PM »
Please add option to save any data (trailer) found after JPEG ending. Samsung phone J320F Galaxy J3 (2016) stores the makernotes and Samsung trailer after JPEG ending. It can be very useful for those who rotate/edit/optimize files to save all this data and append it back after modifications. (sample file attached)

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 17944
    • ExifTool Home Page
Re: saving JPEG trailers
« Reply #1 on: February 06, 2020, 08:16:57 AM »
Sure.  I'll add a new Trailer tag that will allow you to read/write/copy/delete the JPEG trailer as a block.  This feature will appear in ExifTool 11.87

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

herb

  • ExifTool Freak
  • *****
  • Posts: 383
Re: saving JPEG trailers
« Reply #2 on: February 14, 2020, 04:53:01 AM »
Hello Phil,

thanks for the new version 11.87 of Exiftool and thanks for this new feature.

But please allow an additional question:
What is the best way to get information about an existing trailer?

exiftool.exe -trailer <file>              gives this information
exiftool.exe -all:all  <file>              does not give any information about a trailer
exiftool.exe -all:all -trailer <file>   gives 2 identical lines with info about the trailer

I think it would be very helpful when exiftool.exe -all:all <file> would give - a 1 line info - about an existing trailer.

Thanks for your comments in advance
Best regards
Herb

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 17944
    • ExifTool Home Page
Re: saving JPEG trailers
« Reply #3 on: February 14, 2020, 07:42:30 AM »
Hi Herb,

ExifTool just extracts any information it finds in the trailer.  You can use the -v or -htmldump option if you want more details.

Yes, -all:all -trailer will show the trailer twice because it is included in -all:all as well.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

herb

  • ExifTool Freak
  • *****
  • Posts: 383
Re: saving JPEG trailers
« Reply #4 on: February 14, 2020, 09:14:58 AM »
Hello Phil,

thanks for your answer.
Quote
Yes, -all:all -trailer will show the trailer twice because it is included in -all:all as well.
This is correct.
But therefore I ask this question, because only-all:all does not give a line like
Code: [Select]
Trailer       : (Binary data 9107 bytes, use -b option to extract)
For my tests I used the file attached by Jaff.

Best regards
Herb

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 17944
    • ExifTool Home Page
Re: saving JPEG trailers
« Reply #5 on: February 14, 2020, 09:21:26 AM »
Hi Herb,

If you look at the Extra Tags documentation, you will see that a number of the tags aren't extracted unless specifically requested.  Adding -trailer to the command line explicitly requests this tag, but also causes it to be displayed.  The API RequestTags option may be used to request a tag without displaying it, so I think you want to do this:

exiftool -api requesttags=trailer -all:all FILE

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

herb

  • ExifTool Freak
  • *****
  • Posts: 383
Re: saving JPEG trailers
« Reply #6 on: February 14, 2020, 09:28:35 AM »
Hello Phil,

thanks for the private lesson.

Best regards
Herb

herb

  • ExifTool Freak
  • *****
  • Posts: 383
Re: saving JPEG trailers
« Reply #7 on: February 15, 2020, 06:04:33 AM »
Hello Phil,

sorry, annoying you again: Is there a possibility to get information about the type of a trailer?

Ok, we can use -htmldump option, but I am thinking about a possibility to get this info together with display -all:all

Thanks in advance
Best regards
Herb

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 17944
    • ExifTool Home Page
Re: saving JPEG trailers
« Reply #8 on: February 15, 2020, 07:26:01 AM »
Hi Herb,

No, the trailer type is not identified in the ExifTool output, other than -htmldump or -v.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).