GNOME Bugzilla – Bug 53278
TGA's created in gimp need to flipped vertically
Last modified: 2009-08-15 18:40:50 UTC
Overview Description: TGA's created in the GIMP need to flipped horizontally and rotated 180 degrees .....at least according to OpenIL, and Adobe Photoshop and my own TGA loader Steps to Reproduce: 1) Save an Image as a TGA file 2) Load in OpenGL, OpenIl, or Adobe Photoshop.. etc etc Actual Results: Flipped and rotated image Expected Results: Normal Image Additional Information I was working on a project on mine using OpenGL and a bunch of TGA's that I have created in The GIMP and I noticed that the textures I was using were backwards and upside down. At first I thought it was my image loading code, so I switched to OpenIL, that didn't work, so I switch to another TGA loader and that didn't work. So I converted all my imags to PNG's and everything was peachy. Alright I knew it wasn't my code any more so I decided to find the bug...I created a bunch a bunch of TGA's and rebooted into Windows and loaded up my TGA's that I created in GIMP in Adobe and ...sure enough they were upside down and backwards.. so I rotated and flipped them rebooted and loaded them into my project and everything was fine. I tried this with different sized images, different colour depths... every time the same. The weird part is that the GIMP loaded the images that I altered in Adobe with no problems...... so it's just the saving that has a bug... Kyle
Re-assigning all Gimp bugs to default component owner (Gimp bugs list)
I cannot confirm this bug, because I cannot reproduce the problem. I created an image with the Gimp, typed some text in it (it is very easy to see when the text has been flipped) and saved it as TGA (without RLE compression). I tried to re-load it in the Gimp, and everything looks OK. I tried to re-load it in "xv", and everything looks OK as well. I tried to convert the image with "tgatoppm" and the resulting PPM image looked OK as well. I got the same results under Linux (x86) and Solaris (sparc), both running the Gimp 1.2.1. I do not have Windows or Photoshop right now so I cannot test the image with other programs, but I would be surprised to any difference. If this problem is real, then I suggest that you attach three files to this bug report, so that we can investigate the problem: - the original image saved in XCF or PNG format, - the TGA image saved by the Gimp and displayed incorrectly in PS, - the TGA image rotated, flipped and re-saved by PS. You could also add a screenshot of the PS window displaying the 2nd image incorrectly.
As Raphael has realised, these TGAs are valid, but lots of software is too simple minded to check the header structures. Apparently that includes Adobe Photoshop. Well, what a surprise. I can probably re-wire the Gimp TGA plug-in to create TGAs with a different orientation at some point to work around this bug, but I do not think this is a high priority for us. Reporter, change your software to detect the orientation bits in the TGA header and flip the image as required.
A patch for this bug has been applied to 1.2 CVS based on a submission to Gimp-devel from an interested user, Russell Valentine <russ_allegro@yahoo.com>. Gimp can now (by default does) create images with an origin at the bottom right. An equivalent patch needs to be applied in HEAD. The original summary is misleading BTW, the reporter did two operations (Hflip + rotate) which are equivalent to one (Vflip).
Can someone apply the appropriate patch to HEAD and then mark this bug as RESOLVED FIXED?
Created attachment 6496 [details] [review] TGA patch from 1.2 CVS
Applied the patch to the HEAD branch.
Fix is part of gimp-1.2.3, which has just been released. Bug is now CLOSED.