Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

while converting some jpg files to crn, they end upside down #33

Closed
illwieckz opened this issue Aug 4, 2019 · 2 comments

Comments

@illwieckz
Copy link
Member

commented Aug 4, 2019

I discovered the bug while toying with metro and cruz Tremulous map (trying to port them to Unvanquished) and I noticed some textures were upsede-down. I first tought it may be a bug in engine in the crunch tool, then after some investigations I discovered it is a bug in the convert tool by the ImageMagick project.

See https://bugs.launchpad.net/ubuntu/+source/imagemagick/+bug/1838860

You can have a look at the bug there:

convert jpg to tga upside down

Image samples that are known to fail can be found there:
https://dl.illwieckz.net/b/imagemagick/bugs/convert-jpg-to-tga-upside-down/convert-jpg-to-tga-upside-down-samples.zip

Basically, the urcheon tool converts using convert any textures to a tga file before feeding crunch, this allows urcheon to convert any image format to crn as long as imagemagick groks the format, even if crunch itself does not support the given format.

I used the tga format as a transient format because in the past I discovered that crunch had some trouble with some png file. Since convert is known to convert properly those jpg to png then those png to tga, we may use a png transient file to produce the tga file, that would make Urcheon doing:

jpgpngtgacrn

This to be sure to workaround all the bugs from any software stack…

What a mess!

@illwieckz

This comment has been minimized.

Copy link
Member Author

commented Aug 4, 2019

Bad news, doing jpgpngtgacrn is not enough…

In some case the upside-down bug is done in the pngtga step…

@illwieckz

This comment has been minimized.

Copy link
Member Author

commented Aug 4, 2019

It looks like that If I strip metadata using -strip option an every convert steps on this "two convert step" way, the bug is entirely worked around.

@illwieckz illwieckz closed this in b9a42f6 Aug 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.