QImageWriter and EXIF
-
Might be, I can't confirm, I don't have images containing such data to test.
-
@samdol what about this EXIF helper code?
wrote on 13 Oct 2017, 01:08 last edited by samdol@Pablo-J.-Rogina
Thank you, I used it before. but it only reads exif information. Because I want to preserve EXIF after save image, I need a method to read/write exif. -
wrote on 13 Oct 2017, 01:19 last edited by samdol
@SGaist
I found that Reading Gps information should be like this,qDebug()<<"laa: "<< QString::number(value_GpsLatitude.toRationalVector().at(0).first)+"/"+QString::number(value_GpsLatitude.toRationalVector().at(0).second); qDebug()<<"laa: "<< QString::number(value_GpsLatitude.toRationalVector().at(1).first)+"/"+QString::number(value_GpsLatitude.toRationalVector().at(1).second); qDebug()<<"laa: "<< QString::number(value_GpsLatitude.toRationalVector().at(2).first)+"/"+QString::number(value_GpsLatitude.toRationalVector().at(2).second);
But I still don't understand why it changes Gps value after
header.saveToJpeg("C:/myfile.jpg");
It changes even without
header.setValue(QExifImageHeader::GpsLatitude, value_GpsLatitude);
It seems a bug.
You may get test jpg file with gps_tag from here -
@SGaist
I found that Reading Gps information should be like this,qDebug()<<"laa: "<< QString::number(value_GpsLatitude.toRationalVector().at(0).first)+"/"+QString::number(value_GpsLatitude.toRationalVector().at(0).second); qDebug()<<"laa: "<< QString::number(value_GpsLatitude.toRationalVector().at(1).first)+"/"+QString::number(value_GpsLatitude.toRationalVector().at(1).second); qDebug()<<"laa: "<< QString::number(value_GpsLatitude.toRationalVector().at(2).first)+"/"+QString::number(value_GpsLatitude.toRationalVector().at(2).second);
But I still don't understand why it changes Gps value after
header.saveToJpeg("C:/myfile.jpg");
It changes even without
header.setValue(QExifImageHeader::GpsLatitude, value_GpsLatitude);
It seems a bug.
You may get test jpg file with gps_tag from herewrote on 17 Dec 2018, 16:13 last edited by@samdol I have the same problem.
If I load metadata and then I save without changing anything I read incorrect value.
Have you find a solution?QExifImageHeader * source = new QExifImageHeader(); QExifValue *vale; source->loadFromJpeg(filedest); source->saveToJpeg(filedest); QExifImageHeader * dest = new QExifImageHeader(); dest->loadFromJpeg(filedest);
Thanke you for your help
Luisa
-
IIRC, when I took a look at it, there was an issue with handling some of the tags. I can't remember exactly what it was.
-
IIRC, when I took a look at it, there was an issue with handling some of the tags. I can't remember exactly what it was.
-
@SGaist Do you know a library that I could use to read / write exif files? I need to cross compile it for a system embedded. I tried exiv2 with poor results
-
@jsulm I try to use this library but I have some problem with GPSAltitude and so on...
Have you some example to write GPS param into file jpg?
and Usercomment field?Thank you so much
@Luisa Sorry, I don't have any examples
-
@Luisa
Hi
I was wondering if the sample
https://github.com/libexif/libexif/blob/master/contrib/examples/write-exif.c
combined with the info from
https://libexif.github.io/internals/exif-entry_8c-source.htmlEXIF_TAG_USER_COMMENT
EXIF_TAG_GPS_VERSION_ID
EXIF_TAG_GPS_ALTITUDE_REF:might work ?
-
@jsulm I try to use this library but I have some problem with GPSAltitude and so on...
Have you some example to write GPS param into file jpg?
and Usercomment field?Thank you so much
wrote on 19 Dec 2018, 12:53 last edited by@Luisa said in QImageWriter and EXIF:
I try to use this library but I have some problem with GPSAltitude and so on...
Could you please show the issue?