summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-dotnet/libgdiplus/files/libgdiplus-1.2.5-imglibs.patch')
-rw-r--r--dev-dotnet/libgdiplus/files/libgdiplus-1.2.5-imglibs.patch212
1 files changed, 212 insertions, 0 deletions
diff --git a/dev-dotnet/libgdiplus/files/libgdiplus-1.2.5-imglibs.patch b/dev-dotnet/libgdiplus/files/libgdiplus-1.2.5-imglibs.patch
new file mode 100644
index 000000000000..109d8c5e1342
--- /dev/null
+++ b/dev-dotnet/libgdiplus/files/libgdiplus-1.2.5-imglibs.patch
@@ -0,0 +1,212 @@
+--- src/image.c 2007-07-24 21:12:28.000000000 +0000
++++ src/image.c 2007-09-23 17:34:34.000000000 +0000
+@@ -915,18 +915,26 @@
+ case BMP:
+ status = gdip_load_bmp_image_from_file (fp, &result);
+ break;
++#ifdef HAVE_LIBTIFF
+ case TIF:
+ status = gdip_load_tiff_image_from_file (fp, &result);
+ break;
++#endif
++#ifdef HAVE_LIBGIF
+ case GIF:
+ status = gdip_load_gif_image_from_file (fp, &result);
+ break;
++#endif
++#ifdef HAVE_LIBPNG
+ case PNG:
+ status = gdip_load_png_image_from_file (fp, &result);
+ break;
++#endif
++#ifdef HAVE_LIBJPEG
+ case JPEG:
+ status = gdip_load_jpeg_image_from_file (fp, file_name, &result);
+ break;
++#endif
+ case ICON:
+ status = gdip_load_ico_image_from_file (fp, &result);
+ break;
+@@ -1012,18 +1020,22 @@
+ file_name = (char *) ucs2_to_utf8 ((const gunichar2 *)file, -1);
+ if (file_name == NULL)
+ return InvalidParameter;
+-
++
++#ifdef HAVE_LIBGIF
+ if (format == GIF) { /* gif library has to open the file itself*/
+ status = gdip_save_gif_image_to_file ((BYTE*)file_name, image);
+ GdipFree (file_name);
+ return status;
+- } else if (format == TIF) {
++ } else
++#endif
++#ifdef HAVE_LIBTIFF
++ if (format == TIF) {
+ /* tif library has to open the file itself or seeking will fail when saving multi-page images*/
+ status = gdip_save_tiff_image_to_file ((BYTE*)file_name, image, params);
+ GdipFree (file_name);
+ return status;
+ }
+-
++#endif
+ if ((fp = fopen(file_name, "wb")) == NULL) {
+ GdipFree (file_name);
+ return GenericError;
+@@ -1036,12 +1048,16 @@
+ case ICON:
+ status = gdip_save_bmp_image_to_file (fp, image);
+ break;
++#ifdef HAVE_LIBPNG
+ case PNG:
+ status = gdip_save_png_image_to_file (fp, image, params);
+ break;
++#endif
++#ifdef HAVE_LIBJPEG
+ case JPEG:
+ status = gdip_save_jpeg_image_to_file (fp, image, params);
+ break;
++#endif
+ default:
+ status = NotImplemented;
+ break;
+@@ -1945,7 +1961,7 @@
+ /* GDI+ doesn't support this for metafiles */
+ if (image->type != ImageTypeBitmap)
+ return NotImplemented;
+-
++ /* is it correct if we don't have lib(jpeg,tiff,png) ? */
+ switch(image->image_format) {
+ case TIF:
+ case JPEG:
+@@ -2109,24 +2125,32 @@
+ format = get_image_format ((char *)format_peek, format_peek_sz, &public_format);
+
+ switch (format) {
++#ifdef HAVE_LIBJPEG
+ case JPEG:
+ loader = dstream_input_new (getBytesFunc, seekFunc);
+ status = gdip_load_jpeg_image_from_stream_delegate (loader, &result);
+ break;
++#endif
++#ifdef HAVE_LIBPNG
+ case PNG:
+ status = gdip_load_png_image_from_stream_delegate (getBytesFunc, seekFunc, &result);
+ break;
++#endif
+ case BMP:
+ loader = dstream_input_new (getBytesFunc, seekFunc);
+ status = gdip_load_bmp_image_from_stream_delegate (loader, &result);
+ break;
++#ifdef HAVE_LIBTIFF
+ case TIF:
+ status = gdip_load_tiff_image_from_stream_delegate (getBytesFunc, putBytesFunc,
+ seekFunc, closeFunc, sizeFunc, &result);
+ break;
++#endif
++#ifdef HAVE_LIBGIF
+ case GIF:
+ status = gdip_load_gif_image_from_stream_delegate (getBytesFunc, seekFunc, &result);
+ break;
++#endif
+ case ICON:
+ loader = dstream_input_new (getBytesFunc, seekFunc);
+ status = gdip_load_ico_image_from_stream_delegate (loader, &result);
+@@ -2172,15 +2196,23 @@
+ case ICON:
+ case BMP:
+ return gdip_save_bmp_image_to_stream_delegate (putBytesFunc, image);
++#ifdef HAVE_LIBPNG
+ case PNG:
+ return gdip_save_png_image_to_stream_delegate (putBytesFunc, image, params);
++#endif
++#ifdef HAVE_LIBJPEG
+ case JPEG:
+ return gdip_save_jpeg_image_to_stream_delegate (putBytesFunc, image, params);
++#endif
++#ifdef HAVE_LIBGIF
+ case GIF:
+ return gdip_save_gif_image_to_stream_delegate (putBytesFunc, image, params);
++#endif
++#ifdef HAVE_LIBTIFF
+ case TIF:
+ return gdip_save_tiff_image_to_stream_delegate (getBytesFunc, putBytesFunc,
+ seekFunc, closeFunc, sizeFunc, image, params);
++#endif
+ case INVALID:
+ return UnknownImageFormat;
+ default:
+@@ -2217,6 +2249,7 @@
+ dpos += sizeof (ImageCodecInfo);
+ g_decoders++;
+
++#ifdef HAVE_LIBJPEG
+ /* JPEG codec (encoder+decoder) */
+ if (gdip_getcodecinfo_jpeg ()) {
+ memcpy (dpos, gdip_getcodecinfo_jpeg(), sizeof (ImageCodecInfo));
+@@ -2226,7 +2259,8 @@
+ epos += sizeof (ImageCodecInfo);
+ g_encoders++;
+ }
+-
++#endif
++#ifdef HAVE_LIBGIF
+ /* GIF codec (encoder+decoder) */
+ if (gdip_getcodecinfo_gif ()) {
+ memcpy (dpos, gdip_getcodecinfo_gif (), sizeof (ImageCodecInfo));
+@@ -2236,7 +2270,8 @@
+ epos += sizeof (ImageCodecInfo);
+ g_encoders++;
+ }
+-
++#endif
++#ifdef HAVE_LIBTIFF
+ /* TIFF codec (encoder+decoder) */
+ if (gdip_getcodecinfo_tiff ()) {
+ memcpy (dpos, gdip_getcodecinfo_tiff (), sizeof (ImageCodecInfo));
+@@ -2246,7 +2281,8 @@
+ epos += sizeof (ImageCodecInfo);
+ g_encoders++;
+ }
+-
++#endif
++#ifdef HAVE_LIBPNG
+ /* PNG codec (encoder+decoder) */
+ if (gdip_getcodecinfo_png ()) {
+ memcpy (dpos, gdip_getcodecinfo_png (), sizeof (ImageCodecInfo));
+@@ -2256,7 +2292,7 @@
+ epos += sizeof (ImageCodecInfo);
+ g_encoders++;
+ }
+-
++#endif
+ /* WMF codec (decoder-only) */
+ if (gdip_getcodecinfo_wmf ()) {
+ memcpy (dpos, gdip_getcodecinfo_wmf (), sizeof (ImageCodecInfo));
+@@ -2386,9 +2422,11 @@
+ fmt = gdip_get_imageformat_from_codec_clsid ((CLSID *) clsidEncoder);
+
+ switch (fmt) {
++#ifdef HAVE_LIBJPEG
+ case JPEG:
+ *size = gdip_get_encoder_parameter_list_size_jpeg ();
+ return Ok;
++#endif
+ case TIF:
+ *size = 0;
+ return NotImplemented;
+@@ -2410,10 +2448,14 @@
+ fmt = gdip_get_imageformat_from_codec_clsid ((CLSID *) clsidEncoder);
+
+ switch (fmt) {
++#ifdef HAVE_LIBJPEG
+ case JPEG:
+ return gdip_fill_encoder_parameter_list_jpeg (buffer, size);
++#endif
++#ifdef HAVE_LIBTIFF
+ case TIF:
+ return NotImplemented;
++#endif
+ default:
+ break;
+ }