[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: pcb.git: branch: master updated (8eac3630132ca958a1cd56ebf491cb7863b23bdf)



The branch, master has been updated
       via  8eac3630132ca958a1cd56ebf491cb7863b23bdf (commit)
      from  cb9f0505f8342be5034d624c88f013d11c229b6a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 src/hid/png/png.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)


=================
 Commit Messages
=================

commit 8eac3630132ca958a1cd56ebf491cb7863b23bdf
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Don't register the PNG hid if there are no file formats to use.
    
    In some cases, the GD library may not have any usable image formats for
    us to use, resulting in an empty filetypes[] table.  Rather than trying
    to accomodate an empty table during export, it's easier (and perhaps
    better) to simply not register the PNG hid in that case.  Thus, the
    exporter is simply not available when the table is empty.

:100644 100644 279e39c... 06d4296... M	src/hid/png/png.c

=========
 Changes
=========

commit 8eac3630132ca958a1cd56ebf491cb7863b23bdf
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Don't register the PNG hid if there are no file formats to use.
    
    In some cases, the GD library may not have any usable image formats for
    us to use, resulting in an empty filetypes[] table.  Rather than trying
    to accomodate an empty table during export, it's easier (and perhaps
    better) to simply not register the PNG hid in that case.  Thus, the
    exporter is simply not available when the table is empty.

diff --git a/src/hid/png/png.c b/src/hid/png/png.c
index 279e39c..06d4296 100644
--- a/src/hid/png/png.c
+++ b/src/hid/png/png.c
@@ -135,17 +135,26 @@ static int doing_outline, have_outline;
 #define FMT_jpg "JPEG"
 #define FMT_png "PNG"
 
+/* If this table has no elements in it, then we have no reason to
+   register this HID and will refrain from doing so at the end of this
+   file.  */
+
+#undef HAVE_SOME_FORMAT
+
 static const char *filetypes[] = {
 #ifdef HAVE_GDIMAGEPNG
   FMT_png,
+#define HAVE_SOME_FORMAT 1
 #endif
 
 #ifdef HAVE_GDIMAGEGIF
   FMT_gif,
+#define HAVE_SOME_FORMAT 1
 #endif
 
 #ifdef HAVE_GDIMAGEJPEG
   FMT_jpg,
+#define HAVE_SOME_FORMAT 1
 #endif
 
   NULL
@@ -1545,7 +1554,9 @@ hid_png_init ()
   png_hid.calibrate           = png_calibrate;
   png_hid.set_crosshair       = png_set_crosshair;
 
+#ifdef HAVE_SOME_FORMAT
   hid_register_hid (&png_hid);
 
 #include "png_lists.h"
+#endif
 }




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs