Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 6715 → Rev 6716

/branches/Version13x/Scribus/scribus/scimgdataloader_ps.cpp
318,7 → 318,7
CustColors.insert("Yellow", ScColor(0, 0, 255, 0));
CustColors.insert("Black", ScColor(0, 0, 0, 255));
found = parseData(fn);
if ((thumbnail) && (m_imageInfoRecord.exifDataValid))
if ((thumbnail) && (m_imageInfoRecord.exifDataValid) && (!m_imageInfoRecord.exifInfo.thumbnail.isNull()))
{
QTextStream ts2(&BBox, IO_ReadOnly);
ts2 >> x >> y >> b >> h;
329,10 → 329,27
{
m_imageInfoRecord.type = 7;
if (psMode == 4)
{
m_imageInfoRecord.colorspace = 1;
for( int yit=0; yit < m_image.height(); ++yit )
{
QRgb *s = (QRgb*)(m_image.scanLine( yit ));
for(int xit=0; xit < m_image.width(); ++xit )
{
unsigned char cc = 255 - qRed(*s);
unsigned char cm = 255 - qGreen(*s);
unsigned char cy = 255 - qBlue(*s);
unsigned char ck = QMIN(QMIN(cc, cm), cy);
*s = qRgba(cc-ck,cm-ck,cy-ck,ck);
s++;
}
}
}
else
m_imageInfoRecord.colorspace = 0;
}
else
m_imageInfoRecord.colorspace = 0;
return true;
}
if (found)
/branches/Version13x/Scribus/scribus/scimage.cpp
1770,7 → 1770,6
*realCMYK = false;
bool bilevel = false;
short resolutionunit = 0;
bool thumb = false;
RequestType reqType = requestType;
cmsHTRANSFORM xform = 0;
cmsHPROFILE inputProf = 0;
1810,10 → 1809,7
*this = pDataLoader->image();
imgInfo = pDataLoader->imageInfoRecord();
if (requestType == Thumbnail)
{
thumb = true;
requestType = RGBData;
}
reqType = RGBData;
if (!cmSettings.useColorManagement() || !useProf)
{
imgInfo.isEmbedded = false;
1911,8 → 1907,6
break;
case Thumbnail:
case RGBData: // RGB
if ((thumb) && (imgInfo.exifDataValid) && (!imgInfo.exifInfo.thumbnail.isNull()))
break;
if (isCMYK)
xform = scCmsCreateTransform(inputProf, inputProfFormat, cmSettings.monitorProfile(), TYPE_RGBA_8, cmSettings.intent(), 0);
break;
2008,8 → 2002,6
case RGBData:
case RGBProof:
case Thumbnail:
if ((thumb) && (imgInfo.exifDataValid) && (!imgInfo.exifInfo.thumbnail.isNull()))
break;
if (isCMYK)
{
for (int i = 0; i < height(); i++)
/branches/Version13x/Scribus/scribus/scimgdataloader_jpeg.cpp
134,11 → 134,37
bool exi = ExifInf.scan(fn);
if ((exi) && (ExifInf.exifDataValid))
{
if (cinfo.output_components == 4)
m_imageInfoRecord.colorspace = 1;
else if (cinfo.output_components == 3)
m_imageInfoRecord.colorspace = 0;
else if (cinfo.output_components == 1)
m_imageInfoRecord.colorspace = 2;
if ((!ExifInf.isNullThumbnail()) && thumbnail)
{
m_image = ExifInf.getThumbnail();
m_imageInfoRecord.exifInfo.thumbnail = ExifInf.getThumbnail();
if (cinfo.output_components == 4)
{
for( int yit=0; yit < m_image.height(); ++yit )
{
QRgb *s = (QRgb*)(m_image.scanLine( yit ));
for(int xit=0; xit < m_image.width(); ++xit )
{
unsigned char cc = 255 - qRed(*s);
unsigned char cm = 255 - qGreen(*s);
unsigned char cy = 255 - qBlue(*s);
unsigned char ck = QMIN(QMIN(cc, cm), cy);
*s = qRgba(cc-ck,cm-ck,cy-ck,ck);
}
s++;
}
}
}
else
m_imageInfoRecord.exifInfo.thumbnail = QImage();
m_imageInfoRecord.exifInfo.cameraName = ExifInf.getCameraModel();
m_imageInfoRecord.exifInfo.cameraVendor = ExifInf.getCameraMake();
m_imageInfoRecord.exifInfo.thumbnail = ExifInf.getThumbnail();
m_imageInfoRecord.exifInfo.comment = ExifInf.getComment();
m_imageInfoRecord.exifInfo.width = ExifInf.getWidth();
m_imageInfoRecord.exifInfo.height = ExifInf.getHeight();
169,12 → 195,6
}
m_imageInfoRecord.xres = qRound(xres);
m_imageInfoRecord.yres = qRound(yres);
if (cinfo.output_components == 4)
m_imageInfoRecord.colorspace = 1;
else if (cinfo.output_components == 3)
m_imageInfoRecord.colorspace = 0;
else if (cinfo.output_components == 1)
m_imageInfoRecord.colorspace = 2;
m_imageInfoRecord.progressive = jpeg_has_multiple_scans(&cinfo);
if ((!ExifInf.isNullThumbnail()) && thumbnail)
{
185,6 → 205,7
}
else
m_imageInfoRecord.exifDataValid = false;
m_imageInfoRecord.exifInfo.thumbnail = QImage();
unsigned int EmbedLen = 0;
unsigned char* EmbedBuffer;
if (read_jpeg_marker(ICC_MARKER,&cinfo, &EmbedBuffer, &EmbedLen))
286,6 → 307,7
m_imageInfoRecord.valid = (m_imageInfoRecord.PDSpathData.size())>0?true:false; // The only interest is vectormask
arrayPhot.resetRawData((const char*)PhotoshopBuffer,PhotoshopLen);
free( PhotoshopBuffer );
m_imageInfoRecord.exifInfo.thumbnail = QImage();
m_imageInfoRecord.exifDataValid = savEx;
}
}