~noskcaj/ubuntu/trusty/gdk-pixbuf/2.30.6

« back to all changes in this revision

Viewing changes to gdk-pixbuf/io-png.c

Tags: upstream-2.26.4
ImportĀ upstreamĀ versionĀ 2.26.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
341
341
        /* Extract embedded ICC profile */
342
342
        retval = png_get_iCCP (png_ptr, info_ptr,
343
343
                               (png_charpp) &icc_profile_title, &compression_type,
344
 
                               (png_charpp) &icc_profile, (png_uint_32*) &icc_profile_size);
 
344
                               (png_bytepp) &icc_profile, (png_uint_32*) &icc_profile_size);
345
345
        if (retval != 0) {
346
346
                icc_profile_base64 = g_base64_encode ((const guchar *) icc_profile, (gsize)icc_profile_size);
347
347
                gdk_pixbuf_set_option (pixbuf, "icc-profile", icc_profile_base64);
653
653
                        g_set_error (lc->error,
654
654
                                     GDK_PIXBUF_ERROR,
655
655
                                     GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
656
 
                                     _("Insufficient memory to store a %ld by %ld image; try exiting some applications to reduce memory usage"),
657
 
                                     width, height);
 
656
                                     _("Insufficient memory to store a %lu by %lu image; try exiting some applications to reduce memory usage"),
 
657
                                     (gulong) width, (gulong) height);
658
658
                }
659
659
                return;
660
660
        }
678
678
        /* Extract embedded ICC profile */
679
679
        retval = png_get_iCCP (png_read_ptr, png_info_ptr,
680
680
                               (png_charpp) &icc_profile_title, &compression_type,
681
 
                               (png_charpp) &icc_profile, &icc_profile_size);
 
681
                               (png_bytepp) &icc_profile, &icc_profile_size);
682
682
        if (retval != 0) {
683
683
                icc_profile_base64 = g_base64_encode ((const guchar *) icc_profile, (gsize)icc_profile_size);
684
684
                gdk_pixbuf_set_option (lc->pixbuf, "icc-profile", icc_profile_base64);
776
776
png_warning_callback (png_structp png_read_ptr,
777
777
                      png_const_charp warning_msg)
778
778
{
779
 
        LoadContext* lc;
780
 
        
781
 
        lc = png_get_error_ptr(png_read_ptr);
782
 
 
783
779
        /* Don't print anything; we should not be dumping junk to
784
780
         * stderr, since that may be bad for some apps. If it's
785
781
         * important enough to display, we need to add a GError
1017
1013
        if (icc_profile != NULL) {
1018
1014
                png_set_iCCP (png_ptr, info_ptr,
1019
1015
                              "ICC profile", PNG_COMPRESSION_TYPE_BASE,
1020
 
                              (gchar*) icc_profile, icc_profile_size);
 
1016
                              (png_bytep) icc_profile, icc_profile_size);
1021
1017
        }
1022
1018
#endif
1023
1019