Author: jghali
Date: Thu Mar 19 21:34:12 2020
New Revision: 23518

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23518
Log:
Code style fixes

Modified:
    trunk/Scribus/scribus/imagedataloaders/scimgdataloader_psd.cpp

Modified: trunk/Scribus/scribus/imagedataloaders/scimgdataloader_psd.cpp
URL: 
http://scribus.net/websvn/diff.php?repname=Scribus&rev=23518&path=/trunk/Scribus/scribus/imagedataloaders/scimgdataloader_psd.cpp
==============================================================================
--- trunk/Scribus/scribus/imagedataloaders/scimgdataloader_psd.cpp      
(original)
+++ trunk/Scribus/scribus/imagedataloaders/scimgdataloader_psd.cpp      Thu Mar 
19 21:34:12 2020
@@ -47,49 +47,49 @@
 {
        m_embeddedProfile.resize(0);
        m_profileComponents = 0;
+
        ScColorProfile prof;
        ScColorMgmtEngine engine(ScCore->defaultEngine);
        QFileInfo fi = QFileInfo(fn);
        if (!fi.exists())
                return;
+
        QString ext = fi.suffix().toLower();
-       if (ext == "psd")
-       {
-               QFile f(fn);
-               if (f.open(QIODevice::ReadOnly))
-               {
-                       m_imageInfoRecord.xres = 72;
-                       m_imageInfoRecord.yres = 72;
-                       QDataStream s( &f );
-                       s.setByteOrder( QDataStream::BigEndian );
-                       PSDHeader header;
-                       s >> header;
-                       // Check image file format.
-                       if (s.atEnd() || !IsValid(header))
-                               return;
-                       // Check if it's a supported format.
-                       if (!IsSupported(header))
-                               return;
-                       if (!LoadPSDResources(s, header, s.device()->pos()))
-                               return;
-                       if (m_embeddedProfile.size() > 0)
-                       {
-                               prof = 
engine.openProfileFromMem(m_embeddedProfile.data());
-                               if (prof)
-                               {
-                                       if (prof.colorSpace() == ColorSpace_Rgb)
-                                               m_profileComponents = 3;
-                                       if (prof.colorSpace() == 
ColorSpace_Cmyk)
-                                               m_profileComponents = 4;
-                                       if (prof.colorSpace() == 
ColorSpace_Gray)
-                                               m_profileComponents = 1;
-                               }
-                       }
-                       f.close();
-               }
-               else
-                       return;
-       }
+       if (ext != "psd")
+               return;
+
+       QFile f(fn);
+       if (!f.open(QIODevice::ReadOnly))
+               return;
+
+       m_imageInfoRecord.xres = 72;
+       m_imageInfoRecord.yres = 72;
+       QDataStream s( &f );
+       s.setByteOrder( QDataStream::BigEndian );
+       PSDHeader header;
+       s >> header;
+       // Check image file format.
+       if (s.atEnd() || !IsValid(header))
+               return;
+       // Check if it's a supported format.
+       if (!IsSupported(header))
+               return;
+       if (!LoadPSDResources(s, header, s.device()->pos()))
+               return;
+       if (m_embeddedProfile.size() > 0)
+       {
+               prof = engine.openProfileFromMem(m_embeddedProfile.data());
+               if (prof)
+               {
+                       if (prof.colorSpace() == ColorSpace_Rgb)
+                               m_profileComponents = 3;
+                       if (prof.colorSpace() == ColorSpace_Cmyk)
+                               m_profileComponents = 4;
+                       if (prof.colorSpace() == ColorSpace_Gray)
+                               m_profileComponents = 1;
+               }
+       }
+       f.close();
 }
 
 bool ScImgDataLoader_PSD::preloadAlphaChannel(const QString& fn, int /*page*/, 
int res, bool& hasAlpha)


_______________________________________________
scribus-commit mailing list
[email protected]
http://lists.scribus.net/mailman/listinfo/scribus-commit

Reply via email to