Photoshop JPEG_Quality Tags

Started by sebastian, November 21, 2011, 08:30:08 AM

Previous topic - Next topic

sebastian

Hi,
how can in adress the "Photoshop JPEG_Quality Tags" in the Config File?

I like to change the PhotoshopFormat Tag.

Quote0x0406 => {
            Name => 'PhotoshopFormat',
            Writable => 1,
            ValueConv => '\$val',
            ValueConvInv => '$val',
        },

What is the correct Hex Offset for these Tags?
How can i set them to writable with the Config File?

Quote
0    PhotoshopQuality
1    PhotoshopFormat
2    ProgressiveScans


Thanks!

Phil Harvey

Hi Sebastian,

The Photoshop Tag Name documenation lists the Tag ID's of the Photoshop tags.  Also, see the Photoshop.pm source code for examples of how these tags are defined.

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

sebastian

Hi Phil,
thanks for your fast response!

In the "Photoshop Tag Name documenation" i only find the tag id 0x0406 for JPEG_Quality, i thinks this is a tag group because there are the child tags: PhotoshopQuality, PhotoshopFormat and ProgressiveScans

The Photoshop.pm has many answers:
Quote# Photoshop JPEG quality record (ref 2)
%Image::ExifTool::Photoshop::JPEG_Quality = (
    PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
    WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
    CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
    FORMAT => 'int16s',
    GROUPS => { 2 => 'Image' },
    0 => {
        Name => 'PhotoshopQuality',
        Writable => 1,
        PrintConv => '$val + 4',
        PrintConvInv => '$val - 4',
    },
    1 => {
        Name => 'PhotoshopFormat',
        PrintConv => {
            0x0000 => 'Standard',
            0x0001 => 'Optimised',
            0x0101 => 'Progressive',
        },
    },
    2 => {
        Name => 'ProgressiveScans',
        PrintConv => {
            1 => '3 Scans',
            2 => '4 Scans',
            3 => '5 Scans',
        },
    },
);

But how can i put this in my config file?

This won't work..
Quote'Image::ExifTool::Photoshop::JPEG_Quality' => {
        0x0406 => {
          GROUPS => { 2 => 'Image' },
          0 => {
              Name => 'PhotoshopQuality',
              Writable => 1,
              PrintConv => '$val + 4',
              PrintConvInv => '$val - 4',
          },
          1 => {
              Name => 'PhotoshopFormat',
              Writable => 1,
              PrintConv => {
             
                  0x0000 => 'Standard',
                  0x0001 => 'Optimised',
                  0x0101 => 'Progressive',
              },
          },
          2 => {
              Name => 'ProgressiveScans',
              Writable => 1,
              PrintConv => {
                  1 => '3 Scans',
                  2 => '4 Scans',
                  3 => '5 Scans',
              },
          },
        }

Phil Harvey

Hi Sebastian,

Duplicating %Image::ExifTool::Photoshop::JPEG_Quality in your config file doesn't make much sense unless you want to change something in this table.  You still won't be able to create a JPEG Quality record if one didn't exist before.  Is this what you want to do?

But just for the record, the config file would look like this:

%Image::ExifTool::UserDefined = (
    'Image::ExifTool::Photoshop::Main' => {
        0x0406 => {
            Name => 'JPEG_Quality',
            SubDirectory => {
                TagTable => 'Image::ExifTool::UserDefined::JPEG_Quality',
            },
        },
    },
);

%Image::ExifTool::UserDefined::JPEG_Quality = (
    PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
    WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
    CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
    FORMAT => 'int16s',
    GROUPS => { 2 => 'Image' },
    0 => {
        Name => 'PhotoshopQuality',
        Writable => 1,
        PrintConv => '$val + 4',
        PrintConvInv => '$val - 4',
    },
    1 => {
        Name => 'PhotoshopFormat',
        PrintConv => {
            0x0000 => 'Standard',
            0x0001 => 'Optimised',
            0x0101 => 'Progressive',
        },
    },
    2 => {
        Name => 'ProgressiveScans',
        PrintConv => {
            1 => '3 Scans',
            2 => '4 Scans',
            3 => '5 Scans',
        },
    },
);
1; #end


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

sebastian

Hi Phil,
i like to change or create the tags PhotoshopFormat, ProgressiveScans (PhotoshopQuality works)

Sample command:
Quoteexiftool.exe -config ExifTool.config -Photoshop:PhotoshopQuality="12" -Photoshop:PhotoshopFormat="0x0001" -Photoshop:ProgressiveScans="3 Scans" photoshop_referenz.jpg






Phil Harvey

OK.  Making these tags writable will allow you to change them, but not create them if they didn't exist.  The only way to create this information is to copy it from another file with a different configuration.  See this thread for an example of how to do this.

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

sebastian

Ok, but how can i change them?

There is no tag id for the tags... PhotoshopFormat, ProgressiveScans

Phil Harvey

To enable writing of these tags, just set "Writable => 1," in the config file I posted.

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

sebastian