Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, May 2008
Curious bug


Message 1 in thread

Hello,

I think I have found a curious bug in QImage.

My app can read jpg files and lauches gimp to get them edited. There is a
filewatcher that waits for modifications, and when I am done editing, I can 
valid in my app to get the picture resized, written to a repository and
some data stored in a sqlite file.

Let use a picture taken with a recent camera (Ixus 850 is) while the the
camera was turned at 90°. The picture thus appears rotated in my preview
and in any picture viewer, I launch gimp or another image editor (Krita for
example), rotate the picture, save the file, in my preview and in any
picture viewer  the picture is now in the good orientation, now valid, my
picture gets written...in the original (rotated) way.

This bug seems appear when there are exif data and I am quite sure it
doesn't appear with QPixmap.

Has anybody already saw this strange behaviour ?

TIA

Alain

--
 [ signature omitted ] 

Message 2 in thread

Hi,

> This bug seems appear when there are exif data and I am quite sure it
> doesn't appear with QPixmap.

QPixmap uses QImage internally, so this looks strange. On the other hand, it 
could be that exif data is not (properly?) precessed. Could you post a small 
JPEG file that reproduces the problem with examples/widgets/imageviewer?

-- 
 [ signature omitted ] 

Message 3 in thread

Dimitri wrote:

> Hi,
> 
>> This bug seems appear when there are exif data and I am quite sure it
>> doesn't appear with QPixmap.
> 
> QPixmap uses QImage internally, so this looks strange. On the other hand,
> it could be that exif data is not (properly?) precessed. Could you post a
> small JPEG file that reproduces the problem with
> examples/widgets/imageviewer?
> 

I did build a test case that showed that *I* was wrong (using outdated
data).
Sorry.

Alain

--
 [ signature omitted ] 

Message 4 in thread

On May 1, 2008, at 4:48 PM, denebet wrote:

> My app can read jpg files and lauches gimp to get them edited.  
> There is a
> filewatcher that waits for modifications, and when I am done  
> editing, I can
> valid in my app to get the picture resized, written to a repository  
> and
> some data stored in a sqlite file.

How do you know when it is safe to read the file? Timestamps just  
tell you something happened to the file, not that it is in a proper  
state for others to read. Not that this is the problem, but your  
methodology is on some shaky ground...

Brad

-- 
 [ signature omitted ] 

Message 5 in thread

Brad Howes wrote:

> On May 1, 2008, at 4:48 PM, denebet wrote:
> 
>> My app can read jpg files and lauches gimp to get them edited.
>> There is a
>> filewatcher that waits for modifications, and when I am done
>> editing, I can
>> valid in my app to get the picture resized, written to a repository
>> and
>> some data stored in a sqlite file.
> 
> How do you know when it is safe to read the file? Timestamps just
> tell you something happened to the file, not that it is in a proper
> state for others to read. Not that this is the problem, but your
> methodology is on some shaky ground...
> 

I have a QTimer that loops every 0.5 second and file size is checked at each
iteration. When size doesn't change anymore, I assume that it is OK to
read. Maybe not 100 % foolproof (especially if reading is done over a
network) but good enough for the intented audience.

Alain

--
 [ signature omitted ]