I can not find an option for specifiying the image origin for TGA files.
I am using convert.exe to crop a TGA file. It has the origin in top-left corner. After the crop the origin is bottom-left.
Is there an option to preserve the original setting?
Regarding the origin, i am talking about the header information in the file:
header[17] bits 5 and 4, being 01 means origin is at bottom-left.
header[17] bits 5 and 4, being 10 means origin is at top-left.
Information from here:
https://github.com/processing/processing/issues/1682
See also:
https://en.wikipedia.org/wiki/Truevision_TGA#Header
Thanks for any hints.
I have tried +repage and also -extent with no luck.
Option for TGA format image origin
Re: Option for TGA format image origin
As far as I can tell, there is no such feature, as of ImageMagick 6.9.2-0. IM only ever sets the descriptor/attributes byte to 0, 1, or 8; so bits 5 and 4 are always 0, and the orientation is always bottom-left. (You said bottom-left is 01, but I'm pretty sure it's 00.)
Re: Option for TGA format image origin
Just quoted that guy, can not verify: https://github.com/processing/processing/issues/1682Jason S wrote: (You said bottom-left is 01, but I'm pretty sure it's 00.)
Anyway it is a pity that IM does not honour that attribute
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Option for TGA format image origin
Post a request in the Developers Forum.
Re: Option for TGA format image origin
I just committed a patch to our GIT repository to make sure we preserve the image origin of TGA files. This will be available in the next release of ImageMagick (6.9.2-1). You can also change it yourself by defining 'tga:image-origin', below is an example.
Code: Select all
convert logo: -define tga:image-origin=TopRight logo.tga
Re: Option for TGA format image origin
Works like a charm, thank you.