summaryrefslogtreecommitdiff
path: root/src/cmsxform.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmsxform.c')
-rw-r--r--src/cmsxform.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/cmsxform.c b/src/cmsxform.c
index 8a76dae..eef54e4 100644
--- a/src/cmsxform.c
+++ b/src/cmsxform.c
@@ -369,6 +369,7 @@ _cmsTRANSFORM* AllocEmptyTransform(cmsContext ContextID, cmsUInt32Number InputFo
if (InputFormat == 0 && OutputFormat == 0) {
p ->FromInput = p ->ToOutput = NULL;
+ dwFlags |= cmsFLAGS_CAN_CHANGE_FORMATTER;
}
else {
@@ -509,6 +510,12 @@ cmsHTRANSFORM CMSEXPORT cmsCreateExtendedTransform(cmsContext ContextID,
cmsPipeline* Lut;
cmsUInt32Number LastIntent = Intents[nProfiles-1];
+ // If it is a fake transform
+ if (dwFlags & cmsFLAGS_NULLTRANSFORM)
+ {
+ return AllocEmptyTransform(ContextID, InputFormat, OutputFormat, dwFlags);
+ }
+
// If gamut check is requested, make sure we have a gamut profile
if (dwFlags & cmsFLAGS_GAMUTCHECK) {
if (hGamutProfile == NULL) dwFlags &= ~cmsFLAGS_GAMUTCHECK;
@@ -788,10 +795,9 @@ cmsBool CMSEXPORT cmsChangeBuffersFormat(cmsHTRANSFORM hTransform,
_cmsTRANSFORM* xform = (_cmsTRANSFORM*) hTransform;
cmsFormatter16 FromInput, ToOutput;
- cmsUInt32Number BytesPerPixelInput;
+
- // We only can afford to change formatters if previous transform is at least 16 bits
- BytesPerPixelInput = T_BYTES(xform ->InputFormat);
+ // We only can afford to change formatters if previous transform is at least 16 bits
if (!(xform ->dwOriginalFlags & cmsFLAGS_CAN_CHANGE_FORMATTER)) {
cmsSignalError(xform ->ContextID, cmsERROR_NOT_SUITABLE, "cmsChangeBuffersFormat works only on transforms created originally with at least 16 bits of precision");