roniemartinez / libqpsd

PSD (Photoshop Document) & PSB (Photoshop Big) Plugin for Qt/C++ (Qt4/Qt5)
GNU Lesser General Public License v2.1
108 stars 25 forks source link

CMYK mode: optimized for speed #2

Closed yuezhao closed 11 years ago

roniemartinez commented 11 years ago

Wow thanks! The code I did was somewhat similar but getting errors "QColor::fromCmyk: CMYK parameters out of range"

Seems like the solution is to declare c,m,y,k as quint8 before dropping them into fromCmyk() function. [I recklessly and directly used data[0], data[totalbytes], etc into that function :) ].

Well! It worked like a charm!

yuezhao commented 11 years ago

Yes, I also got "QColor::fromCmyk: CMYK parameters out of range" at first, and it seems result from casting from unsigned char to int. Anyway, I didn't verify it.