Opened 10 years ago

Closed 4 years ago

#8429 closed Feature Requests (fixed)

[gil] Reading TGA images with origin in upper left-hand corner.

Reported by: anonymous Owned by: Stefan Seefeld
Milestone: To Be Determined Component: gil USE GITHUB
Version: Boost Development Trunk Severity: Problem
Keywords: Cc: mateusz@…

Description

Hi,

I know the TGA support is work in progress, but...

I have some TGA files that have bit 5 set in the "Image Descriptor". This causes reader_backend::read_header to throw:

"Unsupported descriptor for targa file"

The quick-n-dirty fix is just to mask out bit 5 in the check and update reader::apply such that read_data operates on a flipped_up_down_view if the bit is set.

Unfortunately I don't have any sample images that I can attach (legal reasons), but when I do I will.

Anyway hope the above is of some use.

Attachments (2)

patch.txt (3.4 KB ) - added by anonymous 10 years ago.
Illustration of changes (quick-n-dirty patch)
Image.zip (20.6 KB ) - added by anonymous 10 years ago.
Sample image file

Download all attachments as: .zip

Change History (8)

by anonymous, 10 years ago

Attachment: patch.txt added

Illustration of changes (quick-n-dirty patch)

by anonymous, 10 years ago

Attachment: Image.zip added

Sample image file

comment:1 by anonymous, 10 years ago

I am not an expert on image formats!

I think you are strictly adhering to the Truevision format. And I think that relaxing that requirement may have consequences w.r.t. run length encoding. It's more complicated than I first thought. None-the-less I would be grateful if you could give this issue your consideration.

comment:2 by anonymous, 10 years ago

I used GIMP2 to generate all four combinations of:

  • RLE compressed/uncompressed and
  • Origin bottom left/top left

With the above patch applied read_image loaded them okay and they saved (as PNG) the right way up.

comment:3 by anonymous, 8 years ago

Version: Boost 1.54.0Boost Development Trunk

comment:4 by Mateusz Loskot, 6 years ago

Cc: mateusz@… added

comment:5 by Stefan Seefeld, 5 years ago

Owner: changed from Hailin Jin to Stefan Seefeld

comment:6 by Mateusz Loskot, 4 years ago

Resolution: fixed
Status: newclosed

This should be fixed as part of

https://github.com/boostorg/gil/issues/33 https://github.com/boostorg/gil/pull/42

If it is not working, please reopen new issue on GitHub

Note: See TracTickets for help on using tickets.