Commit Graph

533 Commits

Author SHA1 Message Date
Michael Natterer
6c29754a73 build the static pixbuf loaders conditionally like the dynamic ones so
2002-05-07  Michael Natterer  <mitch@gimp.org>

	* gdk-pixbuf/Makefile.am: build the static pixbuf loaders
	conditionally like the dynamic ones so --without-lib<foo> is
	honored when building with --disable-modules. (#66867)
2002-05-07 12:59:18 +00:00
Soeren Sandmann
d269c210c5 image files for testing pixbuf loaders the old test-loaders.c split into
Sun May  5 02:22:59 2002  Soeren Sandmann  <sandmann@daimi.au.dk>

	* tests/test-images/*: image files for testing pixbuf loaders
	* tests/pixbuf-*.c: the old test-loaders.c split into four
	different programs
	* tests/Makefile.am: add new pixbuf tests

Sun May  5 02:27:01 2002  Soeren Sandmann  <sandmann@daimi.au.dk>

	* Makefile.am (noinst_PROGRAMS): remove test-loaders (moved to
	gtk+/tests/)
	* test-loaders.c, test-images.h: remove
2002-05-05 00:59:42 +00:00
Matthias Clasen
999748e922 Remove the ISO8859-1 restriction from the description of png tEXt
* gdk-pixbuf-io.c (gdk_pixbuf_save): Remove the ISO8859-1
	restriction from the description of png tEXt parameters.

	* io-png.c (png_text_to_pixbuf_option):
	(gdk_pixbuf__png_image_save): If libpng supports it,
	store and retrieve non-ISO8859-1 text as UTF-8.  (#76172)
2002-04-24 00:09:29 +00:00
Tor Lillqvist
40d637ec03 gdk-pixbuf/Makefile.am (uninstall-libtool-import-lib) Fix typo, thanks to
2002-04-18  Tor Lillqvist  <tml@iki.fi>

	* gdk-pixbuf/Makefile.am (uninstall-libtool-import-lib)
	* gdk/Makefile.am (uninstall-libtool-import-lib): Fix typo,
	thanks to David Sterba for noticing.

	* gtk/gtkmain.h
	* gtk/gtkmain.c (gtk_init_abi_check, gtk_init_check_abi_check): In
	GTK+ 2.0 the GtkWindow struct actually is the same size in gcc on
	Win32 whether compiled with -fnative-struct or not. Unfortunately
	this wan't noticed until now. So, from now on, check some other
	struct, too, for which the use of -fnative-struct still
	matters. GtkBox is one such.
2002-04-18 11:21:21 +00:00
Matthias Clasen
6939510851 More fixes for #77807:
* io-tga.c (get_contiguous_pixbuf): Helper function to create
	a pixbuf with a contiguous pixel array while being careful about
	overflow.

	* io-tga.c (fill_in_context, get_image_pseudocolor,
	get_image_truecolor, get_image_grayscale): Use
	get_contiguous_pixbuf instead of manually allocating image
	storage.

	* io-xpm.c (pixbuf_create_from_xpm):
	* io-pnm.c (gdk_pixbuf__pnm_image_load):
	* io-jpeg.c (gdk_pixbuf__jpeg_image_load): Use gdk_pixbuf_new
	instead of manually allocating image storage.
2002-04-11 21:18:40 +00:00
Matthias Clasen
3bd5fc010a Use priv->image_module->module_name instead of image_type which may be
* gdk-pixbuf-loader.c (gdk_pixbuf_loader_load_module): Use
	priv->image_module->module_name instead of image_type which may
	be NULL.
2002-04-09 00:38:38 +00:00
Matthias Clasen
71e0ad8d9e Restructured to use gdk_pixbuf_new instead of manually allocating image
* io-png.c (gdk_pixbuf__png_image_load): Restructured to use
	gdk_pixbuf_new instead of manually allocating image storage. This
	gives us a good rowstride and overflow checks.  (#77807)
2002-04-06 18:51:40 +00:00
Matthias Clasen
41446c99be Avoid allocating an extra copy of the image by using a
* io-tiff.c (tiff_image_parse): Avoid allocating an extra copy of
	the image by using a TIFFRGBAImage{Begin,Get,End} with suitable
	put functions instead of TIFFRGBAImage. And check image dimensions
	for overflow.
2002-04-05 21:02:07 +00:00
Matthias Clasen
b7333010d0 Fix a doc typo.
* gdk-pixbuf-loader.c (gdk_pixbuf_loader_get_type): Fix a doc typo.
2002-04-03 18:17:14 +00:00
Matthias Clasen
5c16742258 libpng error handlers must not return to their callers, thus longjmp out.
* io-png.c (png_simple_error_callback): libpng error handlers must
	not return to their callers, thus longjmp out. This prevents
	annoying stderr output from the default error handler.
2002-03-29 21:40:01 +00:00
Matthias Clasen
ec35e8112a Don't leak info_ptr.
* io-png.c (gdk_pixbuf__png_image_stop_load): Don't leak info_ptr.

	* io-png.c (gdk_pixbuf__png_image_load): Get rid of unused
	end_info. Also call png_read_end to check proper ending of the png
	file and catch text chunks after the image data.
2002-03-27 22:12:05 +00:00
Matthias Clasen
266c62df8f Make libpng use g_malloc instead of system malloc.
* io-png.c (gdk_pixbuf__png_image_load,
	gdk_pixbuf__png_image_begin_load): Make libpng use g_malloc
	instead of system malloc.
2002-03-26 23:17:31 +00:00
Matthias Clasen
de19229a33 Don't leak pixbuf on error.
* io-tiff.c (tiff_image_parse): Don't leak pixbuf on error.

	* io-gif.c (gdk_pixbuf__gif_image_load_increment): Don't leak
	context->buf on error.

	* gdk-pixbuf-loader.c (gdk_pixbuf_loader_close): Make sure to call
	stop_load even for short images to prevent memleaks.
2002-03-25 23:22:01 +00:00
Matthias Clasen
2a8fc72b0d Changed signature to return success and set a GError parameter, adjusted
* io-png.c (setup_png_transformations): Changed signature to
	return success and set a GError parameter, adjusted all callers.
	Also work around a possible FPE in libpng and always check that
	the new info is sane.
2002-03-25 00:15:00 +00:00
Matthias Clasen
8bad932211 context->updated_func is NULL during a nonincremental load.
* io-wbmp.c (gdk_pixbuf__wbmp_image_load_increment):
	context->updated_func is NULL during a nonincremental load.
	(gdk_pixbuf__wbmp_image_load): Stop reading after the first error.
2002-03-23 21:17:17 +00:00
Matthias Clasen
3b7193dd8b Avoid a double free error if reading the colormap fails.
* io-tga.c (try_colormap, gdk_pixbuf__tga_stop_load): Avoid a
	double free error if reading the colormap fails.

	* io-tiff.c (tiff_image_parse): Make TIFFReadRGBAImage stop on
	errors, since it may otherwise segfault on certain bad TIFFs.
2002-03-21 00:31:23 +00:00
Owen Taylor
8acfd1e9de Patch from Erwann Chenede, #73900 fixing a lot of warnings with Forte CC,
Wed Mar 20 16:36:08 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/*.c: Patch from Erwann Chenede, #73900 fixing
        a lot of warnings with Forte CC, mostly implicit
        casts between void * and function pointers.

        * gdk/gdkevents.c (gdk_event_get_state): GdkEventVisibility's
        state field is not a GdkModifierType. (Also #73900)
2002-03-20 21:47:01 +00:00
Matthias Clasen
ac7e3c9584 Fix assumptions on rowstride by manually allocating a contiguous pixel
* io-tga.c: Fix assumptions on rowstride by manually allocating a
	contiguous pixel buffer. Catch buffer overruns in RLE-modi.
	Support grayscale + alpha (which can be written, but not read (!)
	by the Gimp).
2002-03-18 22:19:24 +00:00
Matthias Clasen
006a84274f Catch invalid frame dimensions.
* io-gif.c (gif_get_frame_info): Catch invalid frame dimensions.
2002-03-15 23:27:55 +00:00
Matthias Clasen
5ebe8faab2 Add valid_ras_test and invalid_bmp_1.
* test-images.h: Add valid_ras_test and invalid_bmp_1.

	* test-loaders.c (main): Add random tests for ras and pnm and an
	invalid bmp which was a crasher until my 2002-03-12 commit.

	* io-pnm.c (gdk_pixbuf__pnm_image_load_increment): Don't unref the
	pixbuf on errors.

	* io-ras.c: Handle some errors.
2002-03-13 18:11:15 +00:00
Sven Neumann
c51692d673 use sequential writes instead of calling memcpy(). Simpler and potentially
2002-03-12  Sven Neumann  <sven@gimp.org>

	* gdk-pixbuf.c (gdk_pixbuf_fill): use sequential writes instead of
	calling memcpy(). Simpler and potentially faster. (#70332)
2002-03-12 20:38:49 +00:00
Matthias Clasen
7c59491ce4 Replace a g_assert_not_reached () which could actually be reached by a
* io-bmp.c (DecodeHeader): Replace a g_assert_not_reached ()
	which could actually be reached by a proper error status return.
2002-03-12 19:49:03 +00:00
Tor Lillqvist
34c06b2b6c gdk-pixbuf/gdk_pixbuf.rc.in gdk/win32/rc/gdk.rc.in Use GTK_API_VERSION.
2002-03-06  Tor Lillqvist  <tml@iki.fi>

	* gdk-pixbuf/gdk_pixbuf.rc.in
	* gdk/win32/rc/gdk.rc.in
	* gtk/gtk-win32.rc.in: Use GTK_API_VERSION.
2002-03-06 01:50:43 +00:00
Matthias Clasen
981574a9be Fix docs.
* gtk/gtktreemodel.c (gtk_tree_row_reference_deleted): Fix docs.

	* gtk/gtkwindow.c (gtk_window_remove_mnemonic):
	(gtk_window_add_mnemonic):
	(gtk_window_mnemonic_activate): Add docs.

	* gtk/gtktreeview.c (gtk_tree_view_get_search_equal_func): Fix
	typo in docs.

	* test-loaders.c, test-images.h: More random tests.

	* io-bmp.c (DecodeHeader): Fail gracefully on OOM here.

	* gtk/gtk-sections.txt: Remove gtk_win32_get_installation_directory.
2002-03-05 22:44:27 +00:00
Owen Taylor
ec09f3ab15 Update version to 2.0.0
Tue Mar  5 15:47:54 2002  Owen Taylor  <otaylor@redhat.com>

        * configure.in test/makefile.msc **.pc.in **/*.am:
	Update version to 2.0.0

        * gtk/Makefile.am (MAINTAINERCLEANFILES): Add stamp
        files.

        * configure.in (GDK_PIXBUF_VERSION): Require GLib 2.0.0,
        Pango, Atk, 1.0.0.

        * m4macros/gtk-2.0.m4: Default to 2.0.0 as the minimum
        version.
2002-03-05 21:04:09 +00:00
Owen Taylor
ef6685731c ue Mar 5 10:39:03 2002 Owen Taylor <otaylor@redhat.com>
* Makefile.am (loaderdir): Put the modules into the
        GTK_BINARY_VERSION directory for consistency with
        immodules and theme engines.
2002-03-05 15:40:48 +00:00
Manish Singh
85f9871f0c shut up CVS 2002-03-04 00:39:44 +00:00
Owen Taylor
b3c0813b93 If we can't load the module using the g_module_build_path() filename, try
Sat Mar  2 22:11:10 2002  Owen Taylor  <otaylor@redhat.com>

        * gdk-pixbuf-io.c (_gdk_pixbuf_load_module): If we
        can't load the module using the g_module_build_path()
        filename, try loading it as a .la file.

        * test-loaders.c: Look for modules in current directory
        rather than .libs, so we find the right .la files.

        * test-loaders.c: Back out some accidental commits.
2002-03-03 03:17:22 +00:00
Owen Taylor
ed5fc07f4e Bullet-proof against integer overflow.
Sat Mar  2 21:28:03 2002  Owen Taylor  <otaylor@redhat.com>

        * gdk-pixbuf.c (gdk_pixbuf_new): Bullet-proof against integer
        overflow.
2002-03-03 02:35:25 +00:00
Tor Lillqvist
5d5f53d95d Remove.
2002-03-03  Tor Lillqvist  <tml@iki.fi>

	* gtk-pixbuf.rc.in: Remove.

	* gdk_pixbuf.rc.in: Name like this instead (wrong name used by
	mistake by Hans).

	* makefile.msc: Corresponding changes.

	* Makefile.am: Use gdk_pixbuf.rc on Win32. Distribute it.
2002-03-02 23:19:59 +00:00
Owen Taylor
dfe5724765 Default to --disable-gtk-doc (avoid Jade breakage) and --disable-static
Sat Mar  2 14:32:50 2002  Owen Taylor  <otaylor@redhat.com>

        * configure.in: Default to --disable-gtk-doc (avoid Jade
        breakage) and --disable-static (static linking causes
        problems with Xft changes.)

        * autogen.sh: Add --enable-gtk-doc by default.

        * Makefile.am: Add a 'mydistcheck' rule that passes
        --enable-gtk-doc to the configure since that is needed
        for 'make dist'.

        * docs/tutorial/Makefile.am (dist-hook): Don't distribute
        the PDF file. (Rule doesn't work on my system, plus it's
        big.)

        * gtk/Makefile.am: 'make dist' fixes.
2002-03-02 20:08:39 +00:00
Matthias Clasen
3a4906e82d Move the call to correct_total() to the right spot. (#72732)
* pixops/pixops.c (tile_make_weights): Move the call to
	correct_total() to the right spot. (#72732)
2002-02-28 18:47:38 +00:00
Owen Taylor
80bf58e01d Use {} not () to group around string assigned to char[]. (#72767, Tomas
Wed Feb 27 18:33:04 2002  Owen Taylor  <otaylor@redhat.com>

	* gdk-pixdata.c (gdk_pixdata_to_csource): Use {} not
	() to group around string assigned to char[]. (#72767,
	Tomas gren)
2002-02-27 23:45:05 +00:00
Hans Breuer
bc94033dd3 new file
2002-02-27  Hans Breuer  <hans@breuer.org>

	* demos/gtk-demo/makefile.msc.in : new file

	* gdk-pixbuf/gtk-pixbuf.rc.in : new file to include
	  version resource
	* gdk-pixbuf/makefile.msc : create and use gdk-pixbuf.res

	* gdk/win32/gdkkeys-win32.c : handle undefined LANG_URDU,
	(gdk_keyval_name) : fix endless looping

	* gtk/gtkfilesel.c : translate_win32_path() static
	* gtk/queryimmodules : print_escaped(), query_module() static

	* gtk/makefile.msc.in : added gtkkeyhash, build gtk-win32.res

	* gtk/stock-icons/makefile.msc : regenerated from directory
	listing (almost all filenames changed)
2002-02-27 16:37:04 +00:00
Havoc Pennington
96387b40ea remove C++-commented debug spew, reported by David L. Cooper
2002-02-21  Havoc Pennington  <hp@pobox.com>

	* gdk-pixbuf-loader.c (gdk_pixbuf_loader_load_module): remove
	C++-commented debug spew, reported by David L. Cooper
2002-02-22 02:00:57 +00:00
Matthias Clasen
38d639c0e8 Make the paned example deprecation-clean.
* docs/tutorial/gtk-tut.sgml, examples/paned/paned.c,
	examples/paned/Makefile: Make the paned example deprecation-clean.

	* various ChangeLog files: correct my email.
2002-02-17 19:59:33 +00:00
Matthias Clasen
bc90028d8d New function to make sure that the weights sum up to the correct total
* pixops/pixops.c (correct_total): New function to make sure
	that the weights sum up to the correct total without introducing
	negative weights.
	(tile_make_weights, bilinear_make_fast_weights,
	bilinear_make_weights): Use correct_total.
2002-02-15 21:11:25 +00:00
Matthias Clasen
a9a06ee44e Add a (#ifdef 0'ed) test provoking a segfault in TIFFReadDirectory().
* test-images.h (tiff1_test_3), test-loaders.c (main): Add a
	(#ifdef 0'ed) test provoking a segfault in TIFFReadDirectory().

	* io-ico.c (DecodeHeader): Check that pixbuf could be allocated.

	* test-images.h (ico_test_2), test-loaders.c (main): Test the
	previous change.

	* io-wbmp.c (gdk_pixbuf__wbmp_image_load_increment): Don't write
	beyond the end of buffer if width % 8 != 0.

	* io-tga.c (try_preload): Enforce that ctx->hdr->type is one of
	the supported types, otherwise parse_data_for_row () will not make
	any progress, leading to an infinite loop.
2002-02-12 23:28:05 +00:00
Owen Taylor
01b9bd9310 Fix handing of overall alpha.
Mon Feb 11 14:31:53 2002  Owen Taylor  <otaylor@redhat.com>

        * pixops/pixops.c (bilinear_make_weights): Fix handing of
        overall alpha.
2002-02-11 19:36:12 +00:00
Matthias Clasen
73aa2bfe05 Enable some tests which should work now.
* test-loaders.c (main): Enable some tests which should work
	now.

	* io-wbmp.c (gdk_pixbuf__wbmp_image_load_increment): Detect
	invalid image dimensions and insufficient memory.

	* io-tga.c (try_preload): Detect invalid image dimensions.
	(gdk_pixbuf__tga_stop_load): Don't try to unref NULL pointers.

	* io-ico.c (DecodeHeader): Detect some invalid headers and
	don't segfault.
2002-02-10 21:06:15 +00:00
Owen Taylor
e16d01d6a6 Force all weight arrays to sum exactly to 65535. (Fixes #70971, reported
Fri Feb  8 23:11:15 2002  Owen Taylor  <otaylor@redhat.com>

        * pixops/pixops.c: Force all weight arrays to sum exactly
        to 65535. (Fixes #70971, reported by Federico Mena Quintero)

        * Makefile.am (libgdk_pixbuf_1_3_la_DEPENDENCIES): Add
        libpixops.la.
2002-02-09 04:14:53 +00:00
Federico Mena Quintero
3ce4e21f09 Fix comment; PixopsInterpType -> GdkInterpType.
2002-02-08  Federico Mena Quintero  <federico@ximian.com>

	* pixops/pixops.h: Fix comment; PixopsInterpType -> GdkInterpType.
2002-02-08 19:52:23 +00:00
Darin Adler
27fec072e3 Wean this from <ctype.h>.
* io-xbm.c: (next_int): Wean this from <ctype.h>.
2002-02-08 19:08:20 +00:00
Matthias Clasen
cfaea03b10 Build the tga loader as a static library. (#70157)
* Makefile.am: Build the tga loader as a static library. (#70157)
2002-02-01 23:59:52 +00:00
Matthias Clasen
50e6308388 Merge 16- and 32-bit ico support from the stable branch. (#61179)
* io-ico.c: Merge 16- and 32-bit ico support from the stable
        branch.  (#61179)

        * io-gif.c: Recomposite all images if the animation size changes
        while loading.  (#70055)

        * gdk-pixbuf.c (gdk-pixbuf-fill): Make it work for subpixbufs.
        (#70055)
2002-02-01 23:43:07 +00:00
Manish Singh
db083331a9 shut up CVS 2002-01-22 22:57:51 +00:00
Manish Singh
1530c14531 Made sure all the error cases involving jpeg or png load/saves clean
Sat Jan 19 20:49:20 2002  Manish Singh  <yosh@gimp.org>

        * io-jpeg.c, io-png.c: Made sure all the error cases involving
        jpeg or png load/saves clean themselves up properly. Marked some
        variables needed for cleanup volatile so they aren't clobbered by
        setjmp.
2002-01-20 04:52:47 +00:00
Owen Taylor
73e0e35a04 Credit Michael Hore for last two changes 2002-01-12 00:26:25 +00:00
Owen Taylor
dee2b1e0b2 Fix integer overflow for the values passed to the pixel functions.
Fri Jan 11 18:05:07 2002  Owen Taylor  <otaylor@redhat.com>

	* pixops/pixops.c: Fix integer overflow for the values
	passed to the pixel functions. (#55148)
2002-01-11 23:08:44 +00:00
Owen Taylor
a458dd72e5 Remove meaningless FIXME.
Fri Jan 11 17:53:58 2002  Owen Taylor  <otaylor@redhat.com>

        * pixops/pixops.c (pixops_scale_nearest): Remove meaningless
        FIXME.

        * pixops/pixops.c (pixops_process): Comment the computation
        of run_end_index and fix some edge cases.

        * pixops/{scale_line_22_33_mmx.S, composite_line_22_4a4_mmx.S:
        composite_line_color_22_4a4_mmx.S}: Handle the case where
        dest <= dest_end properly. (#52001)
2002-01-11 22:54:53 +00:00