Commit 3d75c95f authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

plug-ins/bmp/* plug-ins/faxg3/* plug-ins/fits/* plug-ins/fli/*

2008-08-11  Michael Natterer  <mitch@gimp.org>

	* plug-ins/bmp/*
	* plug-ins/faxg3/*
	* plug-ins/fits/*
	* plug-ins/fli/*
	* plug-ins/ico/*
	* plug-ins/jpeg/*
	* plug-ins/psd/*
	* plug-ins/sgi/*
	* plug-ins/uri/*
	* plug-ins/xjt/*: removed these...

	* plug-ins/file-bmp/*
	* plug-ins/file-faxg3/*
	* plug-ins/file-fits/*
	* plug-ins/file-fli/*
	* plug-ins/file-ico/*
	* plug-ins/file-jpeg/*
	* plug-ins/file-psd/*
	* plug-ins/file-sgi/*
	* plug-ins/file-uri/*
	* plug-ins/file-xjt/*: and moved them here. Changed executable
	names to "file-foo".

	* plug-ins/Makefile.am: changed accordingly.

	* plug-ins/common/*: rename all file plug-ins to file-foo.c. Get
	rid of the names "poppler" and "postscript" and call them
	"file-pdf" and "file-ps" because the conflict with standard
	autofoo targets is gone.

	* plug-ins/common/plugin-defs.pl: changed accordingly.

	* plug-ins/common/mkgen.pl: make sure cflags variables are named
	"PLUG_IN_NAME_CFLAGS" and not "PLUG-IN-NAME_CFLAGS"

	* plug-ins/common/Makefile.am: regenerated.

	* configure.in: change folders and variable names to match above
	changes.


svn path=/trunk/; revision=26494
parent b25e6c06
2008-08-11 Michael Natterer <mitch@gimp.org>
* plug-ins/bmp/*
* plug-ins/faxg3/*
* plug-ins/fits/*
* plug-ins/fli/*
* plug-ins/ico/*
* plug-ins/jpeg/*
* plug-ins/psd/*
* plug-ins/sgi/*
* plug-ins/uri/*
* plug-ins/xjt/*: removed these...
* plug-ins/file-bmp/*
* plug-ins/file-faxg3/*
* plug-ins/file-fits/*
* plug-ins/file-fli/*
* plug-ins/file-ico/*
* plug-ins/file-jpeg/*
* plug-ins/file-psd/*
* plug-ins/file-sgi/*
* plug-ins/file-uri/*
* plug-ins/file-xjt/*: and moved them here. Changed executable
names to "file-foo".
* plug-ins/Makefile.am: changed accordingly.
* plug-ins/common/*: rename all file plug-ins to file-foo.c. Get
rid of the names "poppler" and "postscript" and call them
"file-pdf" and "file-ps" because the conflict with standard
autofoo targets is gone.
* plug-ins/common/plugin-defs.pl: changed accordingly.
* plug-ins/common/mkgen.pl: make sure cflags variables are named
"PLUG_IN_NAME_CFLAGS" and not "PLUG-IN-NAME_CFLAGS"
* plug-ins/common/Makefile.am: regenerated.
* configure.in: change folders and variable names to match above
changes.
2008-08-11 Sven Neumann <sven@gimp.org>
* app/tools/gimptexttool.c: minor coding style cleanups.
......@@ -151,7 +193,7 @@
* modules/colorsel_wheel.c: new module using the GtkHSV widget
which was originally developed from above triangle selector.
* modules/Makefile.am: chaged accordingly.
* modules/Makefile.am: changed accordingly.
2008-08-08 Sven Neumann <sven@gimp.org>
......
......@@ -998,15 +998,15 @@ AC_ARG_WITH(libtiff, [ --without-libtiff build without TIFF support])
have_libtiff=yes
AC_CHECK_LIB(tiff, TIFFReadScanline,
[AC_CHECK_HEADER(tiffio.h,
TIFF_LOAD='tiff-load$(EXEEXT)'; TIFF_SAVE='tiff-save$(EXEEXT)'; LIBTIFF='-ltiff',
FILE_TIFF_LOAD='file-tiff-load$(EXEEXT)'; FILE_TIFF_SAVE='file-tiff-save$(EXEEXT)'; LIBTIFF='-ltiff',
[have_libtiff="no (TIFF header files not found)"])],
[AC_CHECK_LIB(tiff, TIFFWriteScanline,
[AC_CHECK_HEADER(tiffio.h,
TIFF_LOAD='tiff-load$(EXEEXT)'; TIFF_SAVE='tiff-save$(EXEEXT)'; LIBTIFF='-ltiff -ljpeg -lz',
FILE_TIFF_LOAD='file-tiff-load$(EXEEXT)'; FILE_TIFF_SAVE='file-tiff-save$(EXEEXT)'; LIBTIFF='-ltiff -ljpeg -lz',
[have_libtiff="no (TIFF header files not found)"])],
[AC_CHECK_LIB(tiff34, TIFFFlushData,
[AC_CHECK_HEADER(tiffio.h,
TIFF_LOAD='tiff-load$(EXEEXT)'; TIFF_SAVE='tiff-save$(EXEEXT)'; LIBTIFF='-ltiff34 -ljpeg -lz',
FILE_TIFF_LOAD='file-tiff-load$(EXEEXT)'; FILE_TIFF_SAVE='file-tiff-save$(EXEEXT)'; LIBTIFF='-ltiff34 -ljpeg -lz',
[have_libtiff="no (TIFF header files not found)"])],
[have_libtiff="no (TIFF library not found)"], -ljpeg -lz -lm)], -ljpeg -lz -lm)], -lm)
fi
......@@ -1021,8 +1021,8 @@ AC_ARG_WITH(libtiff, [ --without-libtiff build without TIFF support])
MIME_TYPES="$MIME_TYPES;image/tiff"
fi
AC_SUBST(TIFF_LOAD)
AC_SUBST(TIFF_SAVE)
AC_SUBST(FILE_TIFF_LOAD)
AC_SUBST(FILE_TIFF_SAVE)
AC_SUBST(LIBTIFF)
......@@ -1094,7 +1094,7 @@ have_zlib=yes
if test -z "$LIBZ"; then
AC_CHECK_LIB(z, gzsetparams,
[AC_CHECK_HEADER(zlib.h,
PSP='psp$(EXEEXT)'; LIBZ='-lz',
FILE_PSP='file-psp$(EXEEXT)'; LIBZ='-lz',
[have_zlib="no (ZLIB header files not found)"])],
[have_zlib="no (ZLIB library not found)"])
fi
......@@ -1103,8 +1103,8 @@ if test "x$have_zlib" = xyes; then
MIME_TYPES="$MIME_TYPES;image/x-psd"
fi
AC_SUBST(FILE_PSP)
AC_SUBST(LIBZ)
AC_SUBST(PSP)
##################
......@@ -1116,7 +1116,7 @@ AC_ARG_WITH(libpng, [ --without-libpng build without PNG support])
if test "x$with_libpng" != xno; then
have_libpng=yes
PKG_CHECK_MODULES(PNG, libpng,
PNG='png$(EXEEXT)'
FILE_PNG='file-png$(EXEEXT)'
LIBPNG="$PNG_LIBS",
[have_libpng="no (libpng not found)"
AC_MSG_ERROR([
......@@ -1128,7 +1128,7 @@ if test "x$have_libpng" = xyes; then
MIME_TYPES="$MIME_TYPES;image/png;image/x-icon"
fi
AC_SUBST(PNG)
AC_SUBST(FILE_PNG)
AC_SUBST(LIBPNG)
AM_CONDITIONAL(HAVE_PNG, test "x$have_libpng" = xyes)
......@@ -1147,13 +1147,13 @@ AC_ARG_WITH(libmng, [ --without-libmng build without MNG support])
[AC_CHECK_HEADER(libmng.h, mng_ok=yes)],
[have_libmng="no (MNG library not found)"], -lz -lm)
if test "$mng_ok" = yes; then
MNG='mng$(EXEEXT)'; LIBMNG="-lmng $LIBJPEG $LIBPNG"
FILE_MNG='file-mng$(EXEEXT)'; LIBMNG="-lmng $LIBJPEG $LIBPNG"
else
have_libmng="no (MNG header file not found)"
fi
fi
AC_SUBST(MNG)
AC_SUBST(FILE_MNG)
AC_SUBST(LIBMNG)
......@@ -1187,12 +1187,12 @@ if test "x$with_aa" != xno && test -z "$LIBAA"; then
have_libaa=yes
AC_CHECK_LIB(aa, aa_printf,
[AC_CHECK_HEADER(aalib.h,
AA='aa$(EXEEXT)'; LIBAA='-laa',
FILE_AA='file-aa$(EXEEXT)'; LIBAA='-laa',
[have_libaa="no (AA header file not found)"])],
[have_libaa="no (AA library not found)"])
fi
AC_SUBST(AA)
AC_SUBST(FILE_AA)
AC_SUBST(LIBAA)
......@@ -1211,7 +1211,7 @@ have_libxpm=yes
if test -z "$LIBXPM"; then
AC_CHECK_LIB(Xpm, XpmReadFileToXpmImage,
[AC_CHECK_HEADER(X11/xpm.h,
XPM='xpm$(EXEEXT)'; LIBXPM="$X_LIBS $X_PRE_LIBS $lib_X11 -lXpm",
FILE_XPM='file-xpm$(EXEEXT)'; LIBXPM="$X_LIBS $X_PRE_LIBS $lib_X11 -lXpm",
[have_libxpm="no (XPM header file not found)"])],
[have_libxpm="no (XPM library not found)"], $X_PRE_LIBS $lib_X11)
fi
......@@ -1222,7 +1222,7 @@ if test "x$have_libxpm" = xyes; then
MIME_TYPES="$MIME_TYPES;image/x-xpixmap"
fi
AC_SUBST(XPM)
AC_SUBST(FILE_XPM)
AC_SUBST(LIBXPM)
......@@ -1263,7 +1263,7 @@ have_librsvg=no
if test "x$with_librsvg" != xno; then
have_librsvg=yes
PKG_CHECK_MODULES(SVG, librsvg-2.0 >= rsvg_required_version,
SVG='svg$(EXEEXT)'
FILE_SVG='file-svg$(EXEEXT)'
LIBSVG=$SVG_LIBS,
have_librsvg="no (librsvg not found)")
else
......@@ -1274,7 +1274,7 @@ if test "x$have_librsvg" = xyes; then
MIME_TYPES="$MIME_TYPES;image/svg+xml"
fi
AC_SUBST(SVG)
AC_SUBST(FILE_SVG)
AC_SUBST(LIBSVG)
......@@ -1301,7 +1301,7 @@ AC_ARG_WITH(poppler,[ --without-poppler build without poppler support])
if test "x$with_poppler" != xno; then
PKG_CHECK_MODULES(POPPLER,
poppler-glib >= poppler_required_version gthread-2.0,
POPPLER='poppler$(EXEEXT)'
FILE_PDF='file-pdf$(EXEEXT)'
LIBPOPPLER=$POPPLER_LIBS
AC_DEFINE(HAVE_POPPLER, 1, [Define to 1 if libpoppler is available])
have_poppler=yes,
......@@ -1310,7 +1310,7 @@ else
have_poppler="Using PostScript plug-in (libpoppler support disabled)"
fi
AC_SUBST(POPPLER)
AC_SUBST(FILE_PDF)
AC_SUBST(LIBPOPPLER)
......@@ -1407,7 +1407,7 @@ if test "x$WMF_CONFIG" != "xno" ; then
wmf_version=`$WMF_CONFIG --version`
if expr $wmf_version \>= wmf_required_version >/dev/null; then
AC_MSG_RESULT([yes (version $wmf_version)])
WMF='wmf$(EXEEXT)'
FILE_WMF='file-wmf$(EXEEXT)'
LIBWMF=`$WMF_CONFIG --libs`
WMF_CFLAGS=`$WMF_CONFIG --cflags`
else
......@@ -1421,9 +1421,9 @@ if test "x$have_libwmf" = xyes; then
MIME_TYPES="$MIME_TYPES;image/x-wmf"
fi
AC_SUBST(LIBWMF)
AC_SUBST(FILE_WMF)
AC_SUBST(WMF_CFLAGS)
AC_SUBST(WMF)
AC_SUBST(LIBWMF)
################
......@@ -1984,32 +1984,35 @@ app/vectors/Makefile
app/widgets/Makefile
app/xcf/Makefile
plug-ins/Makefile
plug-ins/bmp/Makefile
plug-ins/color-rotate/Makefile
plug-ins/color-rotate/images/Makefile
plug-ins/common/Makefile
plug-ins/faxg3/Makefile
plug-ins/fits/Makefile
plug-ins/file-bmp/Makefile
plug-ins/file-faxg3/Makefile
plug-ins/file-fits/Makefile
plug-ins/file-fli/Makefile
plug-ins/file-ico/Makefile
plug-ins/file-jpeg/Makefile
plug-ins/file-psd/Makefile
plug-ins/file-sgi/Makefile
plug-ins/file-uri/Makefile
plug-ins/file-xjt/Makefile
plug-ins/flame/Makefile
plug-ins/fli/Makefile
plug-ins/fractal-explorer/Makefile
plug-ins/fractal-explorer/examples/Makefile
plug-ins/gfig/Makefile
plug-ins/gfig/gfig-examples/Makefile
plug-ins/gfig/images/Makefile
plug-ins/gradient-flare/Makefile
plug-ins/gradient-flare/flares/Makefile
plug-ins/gimpressionist/Brushes/Makefile
plug-ins/gimpressionist/Makefile
plug-ins/gimpressionist/Paper/Makefile
plug-ins/gimpressionist/Presets/Makefile
plug-ins/gradient-flare/Makefile
plug-ins/gradient-flare/flares/Makefile
plug-ins/help-browser/Makefile
plug-ins/help/Makefile
plug-ins/ico/Makefile
plug-ins/ifs-compose/Makefile
plug-ins/imagemap/Makefile
plug-ins/imagemap/images/Makefile
plug-ins/jpeg/Makefile
plug-ins/lighting/Makefile
plug-ins/lighting/images/Makefile
plug-ins/map-object/Makefile
......@@ -2017,7 +2020,6 @@ plug-ins/maze/Makefile
plug-ins/metadata/Makefile
plug-ins/pagecurl/Makefile
plug-ins/print/Makefile
plug-ins/psd/Makefile
plug-ins/pygimp/Makefile
plug-ins/pygimp/plug-ins/Makefile
plug-ins/script-fu/Makefile
......@@ -2027,11 +2029,9 @@ plug-ins/script-fu/scripts/Makefile
plug-ins/script-fu/scripts/images/Makefile
plug-ins/script-fu/tinyscheme/Makefile
plug-ins/selection-to-path/Makefile
plug-ins/sgi/Makefile
plug-ins/twain/Makefile
plug-ins/uri/Makefile
plug-ins/win-snap/Makefile
plug-ins/xjt/Makefile
plug-ins/common/Makefile
modules/Makefile
devel-docs/Makefile
devel-docs/app/Makefile
......
......@@ -9,7 +9,7 @@ help_browser = help-browser
endif
if BUILD_JPEG
jpeg = jpeg
file_jpeg = file-jpeg
endif
if BUILD_PRINT
......@@ -29,54 +29,54 @@ twain = twain
endif
if HAVE_PNG
ico = ico
file_ico = file-ico
endif
if OS_WIN32
twain = twain
win_snap = win-snap
if HAVE_LIBCURL
uri = uri
file_uri = file-uri
endif
else
uri = uri
file_uri = file-uri
endif
if BUILD_XJT
xjt = xjt
file_xjt = file-xjt
endif
SUBDIRS = \
$(script_fu) \
$(pygimp) \
bmp \
color-rotate \
faxg3 \
fits \
file-bmp \
file-faxg3 \
file-fits \
file-fli \
$(file_ico) \
$(file_jpeg) \
file-psd \
file-sgi \
$(file_uri) \
$(file_xjt) \
flame \
fli \
fractal-explorer \
gfig \
gimpressionist \
gradient-flare \
help \
$(help_browser) \
$(ico) \
ifs-compose \
imagemap \
$(jpeg) \
lighting \
map-object \
maze \
metadata \
pagecurl \
$(print) \
psd \
selection-to-path \
sgi \
$(twain) \
$(uri) \
$(win_snap) \
$(xjt) \
common
This diff is collapsed.
......@@ -39,7 +39,7 @@
#define SAVE_PROC "file-aa-save"
#define PLUG_IN_BINARY "aa"
#define PLUG_IN_BINARY "file-aa"
/*
......
......@@ -34,7 +34,7 @@
#define LOAD_PROC "file-cel-load"
#define SAVE_PROC "file-cel-save"
#define PLUG_IN_BINARY "cel"
#define PLUG_IN_BINARY "file-cel"
static void query (void);
......
......@@ -32,7 +32,7 @@
#define SAVE_PROC "file-csource-save"
#define PLUG_IN_BINARY "csource"
#define PLUG_IN_BINARY "file-csource"
typedef struct
......
......@@ -33,7 +33,7 @@
#define LOAD_PROC "file-desktop-link-load"
#define PLUG_IN_BINARY "desktop-link"
#define PLUG_IN_BINARY "file-desktop-link"
static void query (void);
......
......@@ -38,7 +38,7 @@
#define LOAD_PROC "file-dicom-load"
#define SAVE_PROC "file-dicom-save"
#define PLUG_IN_BINARY "dicom"
#define PLUG_IN_BINARY "file-dicom"
/* A lot of Dicom images are wrongly encoded. By guessing the endian
......
......@@ -69,7 +69,7 @@
#define LOAD_PROC "file-gbr-load"
#define SAVE_PROC "file-gbr-save"
#define PLUG_IN_BINARY "gbr"
#define PLUG_IN_BINARY "file-gbr"
typedef struct
......
......@@ -40,7 +40,7 @@
#define SAVE_PROC "file-gif-save"
#define PLUG_IN_BINARY "gif-save"
#define PLUG_IN_BINARY "file-gif-save"
/* Define only one of these to determine which kind of gif's you would like.
......
......@@ -78,7 +78,7 @@
#define LOAD_PROC "file-gih-load"
#define SAVE_PROC "file-gih-save"
#define PLUG_IN_BINARY "gih"
#define PLUG_IN_BINARY "file-gih"
#define DUMMY_PATTERN_NAME "x"
#define MAXDESCLEN 256
......
......@@ -29,7 +29,7 @@
#define SAVE_PROC "file-header-save"
#define PLUG_IN_BINARY "header"
#define PLUG_IN_BINARY "file-header"
/* Declare some local functions.
......
......@@ -62,7 +62,7 @@
#define SAVE_PROC "file-gtm-save"
#define PLUG_IN_BINARY "html-table"
#define PLUG_IN_BINARY "file-html-table"
/* Typedefs */
......
......@@ -94,7 +94,7 @@
#define SAVE_PROC "file-mng-save"
#define PLUG_IN_BINARY "mng"
#define PLUG_IN_BINARY "file-mng"
#define SCALE_WIDTH 125
enum
......
......@@ -52,7 +52,7 @@
#define LOAD_PROC "file-pat-load"
#define SAVE_PROC "file-pat-save"
#define PLUG_IN_BINARY "pat"
#define PLUG_IN_BINARY "file-pat"
/* local function prototypes */
......
......@@ -35,7 +35,7 @@
#define LOAD_PROC "file-pcx-load"
#define SAVE_PROC "file-pcx-save"
#define PLUG_IN_BINARY "pcx"
#define PLUG_IN_BINARY "file-pcx"
/* Declare local functions. */
......
......@@ -35,7 +35,7 @@
#define LOAD_PROC "file-pdf-load"
#define LOAD_THUMB_PROC "file-pdf-load-thumb"
#define PLUG_IN_BINARY "poppler"
#define PLUG_IN_BINARY "file-pdf"
#define THUMBNAIL_SIZE 128
......
......@@ -55,7 +55,7 @@
#define LOAD_PROC "file-pix-load"
#define SAVE_PROC "file-pix-save"
#define PLUG_IN_BINARY "pix"
#define PLUG_IN_BINARY "file-pix"
/* #define PIX_DEBUG */
......
......@@ -63,7 +63,7 @@
#define SAVE_DEFAULTS_PROC "file-png-save-defaults"
#define GET_DEFAULTS_PROC "file-png-get-defaults"
#define SET_DEFAULTS_PROC "file-png-set-defaults"
#define PLUG_IN_BINARY "png"
#define PLUG_IN_BINARY "file-png"
#define PLUG_IN_VERSION "1.3.4 - 03 September 2002"
#define SCALE_WIDTH 125
......
......@@ -62,7 +62,7 @@
#define PBM_SAVE_PROC "file-pbm-save"
#define PGM_SAVE_PROC "file-pgm-save"
#define PPM_SAVE_PROC "file-ppm-save"
#define PLUG_IN_BINARY "pnm"
#define PLUG_IN_BINARY "file-pnm"
/* Declare local data types
......
......@@ -114,7 +114,7 @@ static char dversio[] = "v1.17 19-Sep-2004";
#define LOAD_PS_THUMB_PROC "file-ps-load-thumb"
#define SAVE_PS_PROC "file-ps-save"
#define SAVE_EPS_PROC "file-eps-save"
#define PLUG_IN_BINARY "postscript"
#define PLUG_IN_BINARY "file-ps"
#define STR_LENGTH 64
......
......@@ -28,7 +28,7 @@
#define LOAD_PROC "file-psp-load"
#define SAVE_PROC "file-psp-save"
#define PLUG_IN_BINARY "psp"
#define PLUG_IN_BINARY "file-psp"
/* set to the level of debugging output you want, 0 for none */
#define PSP_DEBUG 0
......
......@@ -49,7 +49,7 @@
#define LOAD_PROC "file-raw-load"
#define SAVE_PROC "file-raw-save"
#define PLUG_IN_BINARY "raw"
#define PLUG_IN_BINARY "file-raw"
#define PREVIEW_SIZE 350
......
......@@ -52,7 +52,7 @@
#define LOAD_PROC "file-sunras-load"
#define SAVE_PROC "file-sunras-save"
#define PLUG_IN_BINARY "sunras"
#define PLUG_IN_BINARY "file-sunras"
typedef int WRITE_FUN(void*,size_t,size_t,FILE*);
......
......@@ -38,7 +38,7 @@
#define LOAD_PROC "file-svg-load"
#define LOAD_THUMB_PROC "file-svg-load-thumb"
#define PLUG_IN_BINARY "svg"
#define PLUG_IN_BINARY "file-svg"
#define SVG_VERSION "2.5.0"
#define SVG_DEFAULT_RESOLUTION 90.0
#define SVG_DEFAULT_SIZE 500
......
......@@ -95,7 +95,7 @@
#define LOAD_PROC "file-tga-load"
#define SAVE_PROC "file-tga-save"
#define PLUG_IN_BINARY "tga"
#define PLUG_IN_BINARY "file-tga"
typedef enum
{
......@@ -433,38 +433,42 @@ load_image (const gchar *filename)
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
if (!fseek (fp, -26L, SEEK_END)) { /* Is file big enough for a footer? */
if (fread (footer, sizeof (footer), 1, fp) != 1)
{
g_message (_("Cannot read footer from '%s'"),
gimp_filename_to_utf8 (filename));
return -1;
}
else if (memcmp (footer + 8, magic, sizeof (magic)) == 0)
{
/* Check the signature. */
/* Is file big enough for a footer? */
if (!fseek (fp, -26L, SEEK_END))
{
if (fread (footer, sizeof (footer), 1, fp) != 1)
{
g_message (_("Cannot read footer from '%s'"),
gimp_filename_to_utf8 (filename));
return -1;
}
else if (memcmp (footer + 8, magic, sizeof (magic)) == 0)
{
/* Check the signature. */
offset = footer[0] + (footer[1] * 256L) + (footer[2] * 65536L)
+ (footer[3] * 16777216L);
offset = (footer[0] +
footer[1] * 256L +
footer[2] * 65536L +
footer[3] * 16777216L);
if (offset != 0)
{
if (fseek (fp, offset, SEEK_SET) ||
fread (extension, sizeof (extension), 1, fp) != 1)
{
g_message (_("Cannot read extension from '%s'"),
gimp_filename_to_utf8 (filename));
return -1;
}
/* Eventually actually handle version 2 TGA here */
}
}
}
if (offset != 0)
{
if (fseek (fp, offset, SEEK_SET) ||
fread (extension, sizeof (extension), 1, fp) != 1)
{
g_message (_("Cannot read extension from '%s'"),
gimp_filename_to_utf8 (filename));
return -1;
}
/* Eventually actually handle version 2 TGA here */
}
}
}
if (fseek (fp, 0, SEEK_SET) ||
fread (header, sizeof (header), 1, fp) != 1)
{
g_message ("Cannot read header from '%s'",
g_message (_("Cannot read header from '%s'"),
gimp_filename_to_utf8 (filename));
return -1;
}
......@@ -508,7 +512,7 @@ load_image (const gchar *filename)
info.colorMapLength = header[5] + header[6] * 256;
info.colorMapSize = header[7];
info.xOrigin = header[8] + header[9] * 256;
info.xOrigin = header[8] + header[9] * 256;
info.yOrigin = header[10] + header[11] * 256;
info.width = header[12] + header[13] * 256;
info.height = header[14] + header[15] * 256;
......@@ -523,6 +527,16 @@ load_image (const gchar *filename)
if (info.alphaBits == info.bpp)
info.alphaBits = 0;
/* hack to handle yet another flavor of incorrect headers, see bug #540969 */
if (info.alphaBits == 0)
{
if (info.imageType == TGA_TYPE_COLOR && info.bpp == 32)
info.alphaBits = 8;
if (info.imageType == TGA_TYPE_GRAY && info.bpp == 16)
info.alphaBits = 8;
}
switch (info.imageType)
{
case TGA_TYPE_MAPPED:
......@@ -535,8 +549,8 @@ load_image (const gchar *filename)
}
break;
case TGA_TYPE_COLOR:
if (info.bpp != 15 && info.bpp != 16 && info.bpp != 24
&& info.bpp != 32)
if (info.bpp != 15 && info.bpp != 16 &&
info.bpp != 24 && info.bpp != 32)
{
g_message ("Unhandled sub-format in '%s' (type = %u, bpp = %u)",
gimp_filename_to_utf8 (filename),
......@@ -545,8 +559,8 @@ load_image (const gchar *filename)
}
break;
case TGA_TYPE_GRAY:
if (info.bpp != 8
&& (info.alphaBits != 8 || (info.bpp != 16 && info.bpp != 15)))
if (info.bpp != 8 &&
(info.alphaBits != 8 || (info.bpp != 16 && info.bpp != 15)))
{
g_message ("Unhandled sub-format in '%s' (type = %u, bpp = %u)",
gimp_filename_to_utf8 (filename),
......@@ -593,7 +607,9 @@ load_image (const gchar *filename)
}
image_ID = ReadImage (fp, &info, filename);
fclose (fp);
return image_ID;
}
......
......@@ -72,7 +72,7 @@
#define LOAD_PROC "file-tiff-load"
#define PLUG_IN_BINARY "tiff-load"
#define PLUG_IN_BINARY "file-tiff-load"
typedef struct
......