~matttbe/ubuntu/raring/poppler/lp1072129

« back to all changes in this revision

Viewing changes to utils/pdftocairo.cc

  • Committer: Package Import Robot
  • Author(s): Till Kamppeter
  • Date: 2012-01-20 09:25:18 UTC
  • Revision ID: package-import@ubuntu.com-20120120092518-r4niogdfau8cm0vl
Tags: 0.18.3-0ubuntu2
* debian/patches/poppler-lcm2.patch: Ported Poppler from liblcms1 which is
  not maintained any more upstream to the up-to-date liblcms2. Thanks to
  Koji Otani for the patch (LP: #885324).
* debian/control: Build-depend on liblcms2-dev and not on liblcms-dev any
  more.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
#include "PDFDocFactory.h"
51
51
#include "CairoOutputDev.h"
52
52
#if USE_CMS
 
53
#ifdef USE_LCMS1
53
54
#include <lcms.h>
 
55
#else
 
56
#include <lcms2.h>
 
57
#endif
54
58
#endif
55
59
#include <cairo.h>
56
60
#if CAIRO_HAS_PS_SURFACE
257
261
      writer = new PNGWriter(PNGWriter::RGB);
258
262
 
259
263
#if USE_CMS
 
264
#ifdef USE_LCMS1
260
265
    if (icc_data)
261
266
      static_cast<PNGWriter*>(writer)->setICCProfile(cmsTakeProductName(profile), icc_data, icc_data_size);
262
267
    else
263
268
      static_cast<PNGWriter*>(writer)->setSRGBProfile();
 
269
#else
 
270
    if (icc_data) {
 
271
      cmsUInt8Number profileID[17];
 
272
      profileID[16] = '\0';
 
273
 
 
274
      cmsGetHeaderProfileID(profile,profileID);
 
275
      static_cast<PNGWriter*>(writer)->setICCProfile(reinterpret_cast<char *>(profileID), icc_data, icc_data_size);
 
276
    } else {
 
277
      static_cast<PNGWriter*>(writer)->setSRGBProfile();
 
278
    }
 
279
#endif
264
280
#endif
265
281
#endif
266
282