JPG in TIFF - resolution can't be modified

Added by Lars-Daniel Weber 12 months ago

Anyone with an idea, why Xresolution and Yresultion can't be modified? See the example attached.

Neither this,

exiv2 -M "set Exif.Image.XResolution 4578/100" -M "set Exif.Image.YResolution 4578/100" -M "set Exif.Image.ResolutionUnit 2" test.tif
nor that
exiv2 -M "add Exif.Image.XResolution 4578/100" -M "add Exif.Image.YResolution 4578/100" -M "add Exif.Image.ResolutionUnit 2" test.tif
works. The pre-set ppi stays fixed at 111.

I'm using exiv2 0.25 001900 (32 bit build) in Windows 7 (64-bit).

test.tif (862 Bytes)


Replies (4)

RE: JPG in TIFF - resolution can't be modified - Added by Lars-Daniel Weber 12 months ago

Robin Mills wrote:

This is discussed here: http://dev.exiv2.org/boards/3/topics/2595?r=2596#message-2596

Thanks for your hint, but recompiling makes it somehow complicated.

RE: JPG in TIFF - resolution can't be modified - Added by Robin Mills 12 months ago

It's designed to be this way. There are metadata tags which you may not modify. For example, the pixel count per line and the number of scan lines. Resolution is another tag which is protected as "read only". If you change Resolution, you have to change other metadata tags such as the physical image size.

If you want to change Resolution, you have at least two choices:
1) Comment off the "guard" in tiffimage.cpp
2) Use an image editor

RE: JPG in TIFF - resolution can't be modified - Added by Lars-Daniel Weber 12 months ago

Robin Mills wrote:

It's designed to be this way. There are metadata tags which you may not modify. For example, the pixel count per line and the number of scan lines. Resolution is another tag which is protected as "read only". If you change Resolution, you have to change other metadata tags such as the physical image size.

Thanks for your hints. Sorry for telling you this, but it works with "exiftool"... that's why I thought, it would be a bug.

(1-4/4)

Redmine Appliance - Powered by TurnKey Linux