Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mm2/Little-CMS.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorMarti Maria <info@littlecms.com>2010-07-26 18:10:45 +0400
committerMarti Maria <info@littlecms.com>2010-07-26 18:10:45 +0400
commita80a1ec9dc9e84135ad60ed0b18799eccc74b936 (patch)
tree5fada3506419e7376e647f5d9fa4d10e90c92e35 /utils
parent366933f15f68e0128360111f654eeecb5e4ad0b5 (diff)
Fixed a bug in floating point formats
Diffstat (limited to 'utils')
-rw-r--r--utils/tificc/tificc.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/utils/tificc/tificc.c b/utils/tificc/tificc.c
index 4d972b1..ec23d16 100644
--- a/utils/tificc/tificc.c
+++ b/utils/tificc/tificc.c
@@ -198,7 +198,7 @@ cmsUInt32Number GetInputPixelType(TIFF *Bank)
{
uint16 Photometric, bps, spp, extra, PlanarConfig, *info;
uint16 Compression, reverse = 0;
- int ColorChannels, IsPlanar = 0, pt = 0;
+ int ColorChannels, IsPlanar = 0, pt = 0, IsFlt;
TIFFGetField(Bank, TIFFTAG_PHOTOMETRIC, &Photometric);
TIFFGetFieldDefaulted(Bank, TIFFTAG_BITSPERSAMPLE, &bps);
@@ -304,8 +304,9 @@ cmsUInt32Number GetInputPixelType(TIFF *Bank)
// Convert bits per sample to bytes per sample
bps >>= 3;
+ IsFlt = (bps == 0) || (bps == 4);
- return (COLORSPACE_SH(pt)|PLANAR_SH(IsPlanar)|EXTRA_SH(extra)|CHANNELS_SH(ColorChannels)|BYTES_SH(bps)|FLAVOR_SH(reverse));
+ return (FLOAT_SH(IsFlt)|COLORSPACE_SH(pt)|PLANAR_SH(IsPlanar)|EXTRA_SH(extra)|CHANNELS_SH(ColorChannels)|BYTES_SH(bps)|FLAVOR_SH(reverse));
}
@@ -316,8 +317,9 @@ cmsUInt32Number ComputeOutputFormatDescriptor(cmsUInt32Number dwInput, int OutCo
{
int IsPlanar = T_PLANAR(dwInput);
int Channels = ChanCountFromPixelType(OutColorSpace);
+ int IsFlt = (bps == 0) || (bps == 4);
- return (COLORSPACE_SH(OutColorSpace)|PLANAR_SH(IsPlanar)|CHANNELS_SH(Channels)|BYTES_SH(bps));
+ return (FLOAT_SH(IsFlt)|COLORSPACE_SH(OutColorSpace)|PLANAR_SH(IsPlanar)|CHANNELS_SH(Channels)|BYTES_SH(bps));
}
@@ -829,6 +831,8 @@ int TransformImage(TIFF* in, TIFF* out, const char *cDefInpProf)
if (hProof)
cmsCloseProfile(hProof);
+ if (xform == NULL) return 0;
+
// Planar stuff
if (T_PLANAR(wInput))
nPlanes = T_CHANNELS(wInput) + T_EXTRA(wInput);