r19938 by jghali - #12961: Rotated photos are imported with rotation but exported to PDF without the rotation
scribus-commit
scribus-commit at lists.scribus.net
Tue Mar 17 21:58:30 UTC 2015
Author: jghali
Date: Tue Mar 17 21:58:30 2015
New Revision: 19938
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19938
Log:
#12961: Rotated photos are imported with rotation but exported to PDF without the rotation
Modified:
trunk/Scribus/scribus/imagedataloaders/scimgdataloader_jpeg.cpp
trunk/Scribus/scribus/pdflib_core.cpp
trunk/Scribus/scribus/scimagestructs.cpp
trunk/Scribus/scribus/scimagestructs.h
Modified: trunk/Scribus/scribus/imagedataloaders/scimgdataloader_jpeg.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19938&path=/trunk/Scribus/scribus/imagedataloaders/scimgdataloader_jpeg.cpp
==============================================================================
--- trunk/Scribus/scribus/imagedataloaders/scimgdataloader_jpeg.cpp (original)
+++ trunk/Scribus/scribus/imagedataloaders/scimgdataloader_jpeg.cpp Tue Mar 17 21:58:30 2015
@@ -175,6 +175,7 @@
m_imageInfoRecord.exifInfo.comment = ExifInf.getComment();
m_imageInfoRecord.exifInfo.width = ExifInf.getWidth();
m_imageInfoRecord.exifInfo.height = ExifInf.getHeight();
+ m_imageInfoRecord.exifInfo.orientation = ExifInf.getOrientation();
m_imageInfoRecord.exifInfo.userComment = ExifInf.getUserComment();
m_imageInfoRecord.exifInfo.dateTime = ExifInf.getDateTime();
m_imageInfoRecord.exifInfo.ApertureFNumber = ExifInf.getApertureFNumber();
Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19938&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp (original)
+++ trunk/Scribus/scribus/pdflib_core.cpp Tue Mar 17 21:58:30 2015
@@ -10643,7 +10643,9 @@
{
if (((Options.UseRGB || Options.UseProfiles2) && (cm == PDFOptions::Compression_Auto) && (c->effectsInUse.count() == 0) && (img.imgInfo.colorspace == ColorSpaceRGB)) && (!img.imgInfo.progressive) && (!((Options.RecalcPic) && (Options.PicRes < (qMax(72.0 / c->imageXScale(), 72.0 / c->imageYScale()))))))
{
- jpegUseOriginal = true;
+ // #12961 : we must not rely on PDF viewers taking exif infos into account
+ // So if JPEG orientation is non default, do not use the original file
+ jpegUseOriginal = (img.imgInfo.exifInfo.orientation == 1);
cm = PDFOptions::Compression_JPEG;
}
// We can't unfortunately use directly cmyk jpeg files. Otherwise we have to use the /Decode argument in image
Modified: trunk/Scribus/scribus/scimagestructs.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19938&path=/trunk/Scribus/scribus/scimagestructs.cpp
==============================================================================
--- trunk/Scribus/scribus/scimagestructs.cpp (original)
+++ trunk/Scribus/scribus/scimagestructs.cpp Tue Mar 17 21:58:30 2015
@@ -22,8 +22,8 @@
QDataStream & operator<< (QDataStream& stream, const ExifValues & exif)
{
- stream << static_cast<qint32>(exif.width) << static_cast<qint32>(exif.height) << exif.ExposureTime
- << exif.ApertureFNumber << static_cast<qint32>(exif.ISOequivalent) << exif.cameraName
+ stream << static_cast<qint32>(exif.width) << static_cast<qint32>(exif.height) << static_cast<qint32>(exif.orientation)
+ << exif.ExposureTime << exif.ApertureFNumber << static_cast<qint32>(exif.ISOequivalent) << exif.cameraName
<< exif.cameraVendor << exif.comment << exif.userComment << exif.artist << exif.copyright
<< exif.dateTime << exif.thumbnail;
return stream;
@@ -31,12 +31,13 @@
QDataStream & operator>> (QDataStream& stream, ExifValues & exif)
{
- qint32 w, h, iso;
- stream >> w >> h >> exif.ExposureTime >> exif.ApertureFNumber >> iso >> exif.cameraName
+ qint32 w, h, ori, iso;
+ stream >> w >> h >> ori >> exif.ExposureTime >> exif.ApertureFNumber >> iso >> exif.cameraName
>> exif.cameraVendor >> exif.comment >> exif.userComment >> exif.artist >> exif.copyright
>> exif.dateTime >> exif.thumbnail;
exif.width = w;
exif.height = h;
+ exif.orientation = ori;
exif.ISOequivalent = iso;
return stream;
}
@@ -50,6 +51,7 @@
{
width = 0;
height = 0;
+ orientation = 1;
ExposureTime = 0;
ApertureFNumber = 0;
ISOequivalent = 0;
Modified: trunk/Scribus/scribus/scimagestructs.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19938&path=/trunk/Scribus/scribus/scimagestructs.h
==============================================================================
--- trunk/Scribus/scribus/scimagestructs.h (original)
+++ trunk/Scribus/scribus/scimagestructs.h Tue Mar 17 21:58:30 2015
@@ -88,6 +88,7 @@
int width;
int height;
+ int orientation;
float ExposureTime;
float ApertureFNumber;
int ISOequivalent;
More information about the scribus-commit
mailing list