Exif tags
-
Hi all,
I'm kinda new to Qt and I'm trying to read (and possibly write) Exif tags from JPG's. Several googles didn't give me any answers, so I'm trying here. Does anyone have any ideas or possibly even a small example how to do this?
I'm using Qt 4.7
Thanks!
Jzz
-
Hi,
you can read EXIF information with "libexif":http://libexif.sourceforge.net
In the sources you'll find also some examples.
T.
-
If this is for an opensource program, you can use libkexiv2 which wraps libexif with a Qt-based API.
-
Oh, but I'm not really limited to jpg. What image format would you use then?
A little background perhaps... I'm trying to build a chartplotter (for nautical navigation) so I need charts. I draw rectangles with the images as brush. So I need to know for each image what the size is and the scale. That's where the Exif tags come in. But I'm free to choose the image format myself, I need to scan the paper charts.
Any ideas?
Jzz -
I use file "qexifimageheader" to read EXIF tags. I've copied it from Qt sources some time ago. I don't remember the exact Qt version that I copied it from. A note in the file reads "Qt Extended 4.5". Before that I was using a 3rd party lib - it was very slow. qexifimageheader is very fast.
-
[quote author="Jzz5" date="1290883262"]So I need to know for each image what the size is and the scale[/quote]
Maybe I do not understand the question correctly, but image size is returned by
@
QImage::size()
@You may scale image to any dimensions using
@
QImage::scaled()
@ -
Jzz5, since you will save your exif info into your files, it's up to you what to save there. You should use one of standard exif tags, but you can write whatever you want there.
I've glanced at qexifimageheader - it looks like it supports only jpeg. It can read and write exif info.
blex: say you have 1000 images, each of them is a few MB, and you need to read some info from all these files. When you load an image into QImage, you load the whole file - this is too slow in many cases. When you read exif info, you read just a few bytes from the file, yuou don't have to load the whole file into memory.