< prev index next >

src/java.desktop/share/native/liblcms/cmsio0.c

Print this page
@@ -558,10 +558,24 @@
      Icc -> TagCount   = 0;
  
      // Set default version
      Icc ->Version =  0x02100000;
  
+     // Set default CMM (that's me!)
+     Icc ->CMM = lcmsSignature;
+ 
+     // Set default creator
+     // Created by LittleCMS (that's me!)
+     Icc ->creator = lcmsSignature;
+ 
+     // Set default platform
+ #ifdef CMS_IS_WINDOWS_
+     Icc ->platform = cmsSigMicrosoft;
+ #else
+     Icc ->platform = cmsSigMacintosh;
+ #endif
+ 
      // Set default device class
      Icc->DeviceClass = cmsSigDisplayClass;
  
      // Set creation date/time
      if (!_cmsGetTime(&Icc->Created))

@@ -811,15 +825,17 @@
          cmsSignalError(Icc ->ContextID, cmsERROR_BAD_SIGNATURE, "not an ICC profile, invalid signature");
          return FALSE;
      }
  
      // Adjust endianness of the used parameters
+     Icc -> CMM             = _cmsAdjustEndianess32(Header.cmmId);
      Icc -> DeviceClass     = (cmsProfileClassSignature) _cmsAdjustEndianess32(Header.deviceClass);
      Icc -> ColorSpace      = (cmsColorSpaceSignature)   _cmsAdjustEndianess32(Header.colorSpace);
      Icc -> PCS             = (cmsColorSpaceSignature)   _cmsAdjustEndianess32(Header.pcs);
  
      Icc -> RenderingIntent = _cmsAdjustEndianess32(Header.renderingIntent);
+     Icc -> platform        = (cmsPlatformSignature)_cmsAdjustEndianess32(Header.platform);
      Icc -> flags           = _cmsAdjustEndianess32(Header.flags);
      Icc -> manufacturer    = _cmsAdjustEndianess32(Header.manufacturer);
      Icc -> model           = _cmsAdjustEndianess32(Header.model);
      Icc -> creator         = _cmsAdjustEndianess32(Header.creator);
  

@@ -920,11 +936,11 @@
      cmsUInt32Number i;
      cmsTagEntry Tag;
      cmsUInt32Number Count;
  
      Header.size        = _cmsAdjustEndianess32(UsedSpace);
-     Header.cmmId       = _cmsAdjustEndianess32(lcmsSignature);
+     Header.cmmId       = _cmsAdjustEndianess32(Icc ->CMM);
      Header.version     = _cmsAdjustEndianess32(Icc ->Version);
  
      Header.deviceClass = (cmsProfileClassSignature) _cmsAdjustEndianess32(Icc -> DeviceClass);
      Header.colorSpace  = (cmsColorSpaceSignature) _cmsAdjustEndianess32(Icc -> ColorSpace);
      Header.pcs         = (cmsColorSpaceSignature) _cmsAdjustEndianess32(Icc -> PCS);

@@ -932,15 +948,11 @@
      //   NOTE: in v4 Timestamp must be in UTC rather than in local time
      _cmsEncodeDateTimeNumber(&Header.date, &Icc ->Created);
  
      Header.magic       = _cmsAdjustEndianess32(cmsMagicNumber);
  
- #ifdef CMS_IS_WINDOWS_
-     Header.platform    = (cmsPlatformSignature) _cmsAdjustEndianess32(cmsSigMicrosoft);
- #else
-     Header.platform    = (cmsPlatformSignature) _cmsAdjustEndianess32(cmsSigMacintosh);
- #endif
+     Header.platform    = (cmsPlatformSignature) _cmsAdjustEndianess32(Icc -> platform);
  
      Header.flags        = _cmsAdjustEndianess32(Icc -> flags);
      Header.manufacturer = _cmsAdjustEndianess32(Icc -> manufacturer);
      Header.model        = _cmsAdjustEndianess32(Icc -> model);
  

@@ -952,12 +964,11 @@
      // Illuminant is always D50
      Header.illuminant.X = (cmsS15Fixed16Number) _cmsAdjustEndianess32((cmsUInt32Number) _cmsDoubleTo15Fixed16(cmsD50_XYZ()->X));
      Header.illuminant.Y = (cmsS15Fixed16Number) _cmsAdjustEndianess32((cmsUInt32Number) _cmsDoubleTo15Fixed16(cmsD50_XYZ()->Y));
      Header.illuminant.Z = (cmsS15Fixed16Number) _cmsAdjustEndianess32((cmsUInt32Number) _cmsDoubleTo15Fixed16(cmsD50_XYZ()->Z));
  
-     // Created by LittleCMS (that's me!)
-     Header.creator      = _cmsAdjustEndianess32(lcmsSignature);
+     Header.creator      = _cmsAdjustEndianess32(Icc ->creator);
  
      memset(&Header.reserved, 0, sizeof(Header.reserved));
  
      // Set profile ID. Endianness is always big endian
      memmove(&Header.profileID, &Icc ->ProfileID, 16);
< prev index next >