Commit Graph

114 Commits

Author SHA1 Message Date
Johan Dahlin
eee7bb2b2e [annotations] Add allow-none
This commit was created using a script that searched for all docstrings
containing a parameter and the string 'or %NULL'.
Gdk backends and demos excluded as they are not part of a public API

https://bugzilla.gnome.org/show_bug.cgi?id=610474
2010-04-03 20:56:15 -04:00
Christian Dywan
2dea920895 Bug 561186 – GdkPixbuf API type checking needs cleanup
2008-11-30  Christian Dywan  <christian@imendio.com>

	Bug 561186 – GdkPixbuf API type checking needs cleanup

	* gdk-pixbuf-loader.c (gdk_pixbuf_loader_write),
	(gdk_pixbuf_loader_get_pixbuf), (gdk_pixbuf_loader_get_animation),
	(gdk_pixbuf_loader_close), (gdk_pixbuf_loader_get_format):
	* gdk-pixbuf-scale.c (gdk_pixbuf_scale), (gdk_pixbuf_composite),
	(gdk_pixbuf_composite_color), (gdk_pixbuf_scale_simple),
	(gdk_pixbuf_composite_color_simple):
	* gdk-pixbuf-simple-anim.c (gdk_pixbuf_simple_anim_add_frame):
	* gdk-pixbuf-util.c (gdk_pixbuf_add_alpha),
	(gdk_pixbuf_apply_embedded_orientation):
        Improve type checking in pixbuf API

svn path=/trunk/; revision=21832
2008-11-30 05:22:03 +00:00
Matthias Clasen
827b7e6f66 Bug 517233 – Calling gdk_pixbuf_loader_close causes "GError set over the
2008-09-06  Matthias Clasen  <mclasen@redhat.com>

        Bug 517233 – Calling gdk_pixbuf_loader_close causes "GError set over
        the top of a previous GError" warning

        * gdk-pixbuf-loader.c (gdk_pixbuf_loader_close): Don't overwrite
        errors. Reported by Andrey Tsyvarev


svn path=/trunk/; revision=21309
2008-09-07 05:19:29 +00:00
Matthias Clasen
956f834939 Fix a deadlock in pixbuf loader initialization
svn path=/trunk/; revision=21295
2008-09-05 01:01:22 +00:00
Sven Neumann
d1ceb929b5 use canonical signal names.
2008-08-11  Sven Neumann  <sven@gimp.org>

	* gdk-pixbuf/gdk-pixbuf-loader.c: use canonical signal names.


svn path=/trunk/; revision=21072
2008-08-11 18:40:41 +00:00
Johan Dahlin
d97cdbdf53 Include "config.h" instead of <config.h> Command used: find -name
2008-06-21  Johan Dahlin  <jdahlin@async.com.br>

    * *.[ch]: Include "config.h" instead of <config.h>
    Command used:
    find -name \*.[ch]|xargs perl -p -i -e 's/^#include <config.h>/#include "config.h"/g'
    Rubberstamped by Mitch and Tim


svn path=/trunk/; revision=20669
2008-06-22 14:28:52 +00:00
Michael Natterer
112dad6695 cast the return value of _gdk_pixbuf_scaled_anim_new() to fix incompatible
2008-01-14  Michael Natterer  <mitch@imendio.com>

	* gdk-pixbuf-loader.c (gdk_pixbuf_loader_prepare): cast the return
	value of _gdk_pixbuf_scaled_anim_new() to fix incompatible pointer
	warning.


svn path=/trunk/; revision=19364
2008-01-14 11:30:34 +00:00
Matthias Clasen
d2c4ba3639 Try again to make gdk_pixbuf_get_file_info work for tiff images
svn path=/trunk/; revision=18384
2007-07-05 20:16:59 +00:00
Matthias Clasen
44f7b0657b Be more careful when calling g_propagate_error(). (#453365, Michael
2007-07-03  Matthias Clasen  <mclasen@redhat.com>

        * gdk-pixbuf-loader.c (gdk_pixbuf_loader_close): Be
        more careful when calling g_propagate_error().  (#453365,
        Michael Chudobiak)



svn path=/trunk/; revision=18357
2007-07-03 16:29:58 +00:00
Matthias Clasen
4cd640f72c Implement scaling for animations
svn path=/trunk/; revision=17430
2007-03-08 16:21:09 +00:00
Matthias Clasen
aef468ebbf Protect against stop_load begin broken. (#403255, Lucas Mazzardo Veloso)
2007-02-06  Matthias Clasen  <mclasen@redhat.com>

        * gdk-pixbuf-loader.c (gdk_pixbuf_loader_close): Protect
        against stop_load begin broken.  (#403255, Lucas Mazzardo Veloso)



svn path=/trunk/; revision=17267
2007-02-06 13:56:06 +00:00
Matthias Clasen
5a119668b1 Fix memory leaks in error paths
svn path=/trunk/; revision=17165
2007-01-17 04:24:00 +00:00
Matthias Clasen
1db5905b38 Emit the closed signal when closing the loader, pointed out by David
2006-12-21  Matthias Clasen  <mclasen@redhat.com>

        * gdk-pixbuf-loader.c (gdk_pixbuf_loader_write): Emit
        the closed signal when closing the loader, pointed out
        by David Necas.
2006-12-22 03:14:31 +00:00
Matthias Clasen
2148567e8a Don't spew a warning if the printer is already closed.
2006-12-19  Matthias Clasen  <mclasen@redhat.com>

        * gdk-pixbuf-loader.c (gdk_pixbuf_loader_close): Don't
        spew a warning if the printer is already closed.
2006-12-19 20:45:04 +00:00
Matthias Clasen
b8756357f3 Behave as documented and close the loader when returning FALSE.
2006-12-09  Matthias Clasen  <mclasen@redhat.com>

        * gdk-pixbuf-loader.c (gdk_pixbuf_loader_write): Behave as
        documented and close the loader when returning FALSE.
2006-12-10 04:25:46 +00:00
Matthias Clasen
c48afeca8a Put the code to protect against broken loaders that forget to set error in
2006-07-16  Matthias Clasen  <mclasen@redhat.com>

	* gdk-pixbuf-loader.c (gdk_pixbuf_loader_load_module)
	(gdk_pixbuf_loader_write, gdk_pixbuf_loader_close)
	(gdk_pixbuf_loader_ensure_error): Put the code to protect
	against broken loaders that forget to set error in an
	auxiliary function and call it in more places.  (#346428,
	 Catmur)
2006-07-17 02:37:29 +00:00
Matthias Clasen
113f364a37 More of the same 2006-05-14 04:25:34 +00:00
Matthias Clasen
7d49b31a79 Use G_DEFINE_TYPE 2006-04-04 13:35:59 +00:00
Matthias Clasen
9e4fe9ded3 Remove a pointless check, pointed out by Kjartan Maraas.
2006-03-24  Matthias Clasen  <mclasen@redhat.com>

	* gdk-pixbuf-loader.c (gdk_pixbuf_loader_write): Remove a
	pointless check, pointed out by Kjartan Maraas.
2006-03-24 15:53:22 +00:00
Matthias Clasen
8f069d7bfc Add some documentation about supported image formats, and how to find out
2006-03-22  Matthias Clasen  <mclasen@redhat.com>

	* gdk-pixbuf-loader.c: Add some documentation about
	supported image formats, and how to find out about them.
	(#335536, Murray Cumming)
2006-03-22 20:33:50 +00:00
Matthias Clasen
e3bf16ec14 Only call gdk_pixbuf_loader_eat_header_write() when count > 0. (#318589,
2005-10-12  Matthias Clasen  <mclasen@redhat.com>

	* gdk-pixbuf-loader.c (gdk_pixbuf_loader_write): Only call
	gdk_pixbuf_loader_eat_header_write() when count > 0.  (#318589,
	Bogdan Nicula)
2005-10-12 13:49:26 +00:00
Matthias Clasen
73a27a3cee Use a 1k buffer for sniffing image formats, instead of 128 or 256 bytes.
2005-10-03  Matthias Clasen  <mclasen@redhat.com>

	* gdk-pixbuf-animation.c (gdk_pixbuf_animation_new_from_file):
	* gdk-pixbuf-io.c (gdk_pixbuf_new_from_file):
	* gdk-pixbuf-loader.c: Use a 1k buffer for sniffing image formats,
	instead of 128 or 256 bytes.  (#317225, Sebastien Bacher,
	Dom Lachowicz)
2005-10-03 15:07:35 +00:00
Matthias Clasen
f55cffb074 Intern type names before registering the type to avoid unnecessary copies.
2005-08-31  Matthias Clasen  <mclasen@redhat.com>

	* io-ani-animation.c (gdk_pixbuf_ani_anim_iter_get_type)
	(gdk_pixbuf_ani_anim_get_type):
	* io-gif-animation.c (gdk_pixbuf_gif_anim_get_type)
	(gdk_pixbuf_gif_anim_iter_get_type):
	* gdk-pixbuf-loader.c (gdk_pixbuf_loader_get_type):
	* gdk-pixbuf.c (gdk_pixbuf_get_type):
	* gdk-pixbuf-animation.c (gdk_pixbuf_animation_get_type):
	Intern type names before registering the type to avoid
	unnecessary copies.
2005-08-31 15:18:41 +00:00
Matthias Clasen
eef20f2c83 Make PLT-reduction work with gcc4, and don't include everything in
2005-03-14  Matthias Clasen  <mclasen@redhat.com>

	Make PLT-reduction work with gcc4, and don't include
	everything in gdk-pixbuf-alias.h:

	* gdk-pixbuf.symbols: Group symbols by header and source file.
	* /makegdkpixbufalias.pl: Protect definitions by the same
	preprocessor symbols used to guard the headers. Move
	the alias declarations to a separate file which is
	produced when calling makegdkpixbufalias.pl -def
	* Makefile.am (gdk-pixbuf-aliasdef.c): Add a rule to generate
	this file.
	* *.c: Include gdk-pixbuf-alias.h after the other headers,
	include gdk-pixbuf-aliasdef.c at the bottom.
2005-03-14 19:37:00 +00:00
Matthias Clasen
a66dd6b37d Close the loader before unreffing it in the error case. (#164915, Crispin
2005-01-22  Matthias Clasen  <mclasen@redhat.com>

	* gdk-pixbuf-loader.c (gdk_pixbuf_loader_new_with_type)
	(gdk_pixbuf_loader_new_with_mime_type): Close the loader
	before unreffing it in the error case.  (#164915, Crispin
	Flowerday)
2005-01-23 04:35:09 +00:00
Matthias Clasen
4f9db59bfd Be extra careful when locking and handle the case that the module may
2004-11-15  Matthias Clasen  <mclasen@redhat.com>

	* gdk-pixbuf-animation.c:
	* gdk-pixbuf-loader.c:
	* gdk-pixbuf-io.c: Be extra careful when locking and handle
	the case that the module may initialize the thread system.

	* gdk-pixbuf-io.[hc] (_gdk_pixbuf_lock): Return whether the
	lock was actually taken.
2004-11-16 02:51:19 +00:00
Matthias Clasen
cb918cdb02 Changes to make gdk-pixbuf threadsafe (#157310, #157306, Colin Walters):
2004-11-12  Matthias Clasen  <mclasen@redhat.com>

	Changes to make gdk-pixbuf threadsafe  (#157310, #157306,
	Colin Walters):

	* gdk-pixbuf-io.h (enum GdkPixbufFormatFlags): Add
	GDK_PIXBUF_FORMAT_THREADSAFE to indicate that an image loader
	is threadsafe.

	* gdk-pixbuf-io.c (get_file_formats, _gdk_pixbuf_load_module):
	Use a lock to make initialization of global data structures
	threadsafe.
	* gdk-pixbuf-private.h:
	* gdk-pixbuf-io.c (_gdk_pixbuf_lock, _gdk_pixbuf_unlock):
	Auxiliary functions which use another lock to protect
	threadunsafe image loaders.

	* gdk-pixbuf-io.c (gdk_pixbuf_real_save):
	(save_to_callback_with_tmp_file):
	(gdk_pixbuf_real_save_to_callback):
	(gdk_pixbuf_new_from_xpm_data):
	(_gdk_pixbuf_generic_image_load):
	* gdk-pixbuf-animation.c (gdk_pixbuf_animation_new_from_file):
	* gdk-pixbuf-loader.c (gdk_pixbuf_loader_load_module):
	(gdk_pixbuf_loader_close):
	(gdk_pixbuf_loader_finalize):
	Use _gdk_pixbuf_lock() and _gdk_pixbuf_unlock().

	* io-ani.c, io-bmp.c, io-gif.c, io-ico.c:
	* io-jpeg.c, io-pcx.c, io-png.c, io-pnm.c:
	* io-ras.c, io-tga.c, io-wbmp.c, io-xbm.c:
	* io-xpm.c: Mark as threadsafe.

	* io-tiff.c: Remove pointless locking, mark as
	threadunsafe.
2004-11-12 05:34:31 +00:00
Matthias Clasen
17cf070553 2.5.2 2004-08-25 16:21:15 +00:00
Matthias Clasen
9cc29faa8e Use the correct index, and compare correctly, reported by Tommi
2004-08-24  Matthias Clasen  <mclasen@redhat.com>

	* gdk-pixbuf-loader.c (gdk_pixbuf_loader_new_with_mime_type): Use
	the correct index, and compare correctly, reported by Tommi Komulainen.
2004-08-24 20:25:15 +00:00
Matthias Clasen
162354e628 Use the correct index, reported by Tommi Komulainen.
2004-08-24  Matthias Clasen  <mclasen@redhat.com>

	* gdk-pixbuf-loader.c (gdk_pixbuf_loader_new_with_mime_type): Use
	the correct index, reported by Tommi Komulainen.
2004-08-24 19:53:58 +00:00
Matthias Clasen
f4437de139 Add hidden aliases for exported symbols which are used internally in order
Tue Aug 10 23:53:59 2004  Matthias Clasen  <maclas@gmx.de>

	Add hidden aliases for exported symbols which are
	used internally in order to get rid of many PLT
	entries.  (#145519, Arjan van de Ven)

	* gdk/Makefile.am: Add rules to generate gdk_pixbuf.def and
	gdk-pixbuf-alias.h from gdk-pixbuf.symbols, and make make
	check check the abi with abicheck.sh.

	* gdk/gdk-pixbuf.symbols: New file. Definition of the gdk-pixbuf
	ABI. The file can be processed by cpp to filter out certain
	subsets of symbols.

	* gdk/abicheck.sh: New file. Script to check the actually
	symbols exported from libgdk_pibuf.2.0.so against the symbols
	found in gdk-pixbuf.symbols.

	* gdk/makegdkpixbufalias.pl: New file. Perl script to generate the
	header containing the alias definitions for internally used
	exported symbols from a list of symbols.

	* *.c: Include gdk-pixbuf-alias.h
2004-08-11 04:10:18 +00:00
Federico Mena Quintero
80581c3011 Fixes #136082 and #135265, patch by Morten Welinder.
2004-03-05  Federico Mena Quintero  <federico@ximian.com>

	Fixes #136082 and #135265, patch by Morten Welinder.

	* configure.in: Use AC_SYS_LARGEFILE.

	* */*.c: #include <config.h>
2004-03-06 03:38:59 +00:00
Matthias Clasen
03376d79fa New public API to save pixbufs to non-file locations. (#82203, Tim Evans)
Wed Jan  7 02:41:14 2004  Matthias Clasen  <maclas@gmx.de>

	* gdk-pixbuf-io.c (gdk_pixbuf_save_to_bufferv):
	* gdk-pixbuf-io.c (gdk_pixbuf_save_to_buffer):
	* gdk-pixbuf-io.c (gdk_pixbuf_save_to_callbackv):
	* gdk-pixbuf-io.c (gdk_pixbuf_save_to_callback): New public API
	to save pixbufs to non-file locations.  (#82203, Tim Evans)

	* gdk-pixbuf.h:
	* gdk_pixbuf.def: Declare the new public API.

	* gdk-pixbuf-io.h: Add save_to_callback to the module interface.

	* io-jpeg.c:
	* io-png.c: Implement save_to_callback.

	* gdk-pixbuf-io.c (gdk_pixbuf_savev):
	* gdk-pixbuf-io.c (gdk_pixbuf_save): Update documentation.

	* gdk-pixbuf-io.c (gdk_pixbuf_real_save): Support saving via
	image_module->save_to_callback.

	* gdk-pixbuf-io.c (gdk_pixbuf_real_save_to_callback): New generic
	save_to_callback function which falls back to image_module->save
	on a temp file.
2004-01-07 01:57:42 +00:00
Matthias Clasen
5b26e695a1 Make it possible to call gdk_pixbuf_loader_set_size (loader, 0, 0) by
Wed Jan  7 01:17:36 2004  Matthias Clasen  <maclas@gmx.de>

	* gdk-pixbuf-loader.c (gdk_pixbuf_loader_size_func):
	* gdk-pixbuf-loader.c (gdk_pixbuf_loader_set_size):
	* gdk-pixbuf-loader.c (gdk_pixbuf_loader_init): Make it possible
	to call gdk_pixbuf_loader_set_size (loader, 0, 0) by changing
	the initial values of priv->width/height to -1.

	* io-tiff.c (tiff_image_parse):
	* io-ras.c (RAS2State):
	* io-pnm.c (gdk_pixbuf__pnm_image_load_increment):
	* io-pcx.c (gdk_pixbuf__pcx_load_increment):
	* io-jpeg.c (gdk_pixbuf__jpeg_image_load_increment):
	* io-png.c (png_info_callback):
	* io-ico.c (DecodeHeader):
	* io-bmp.c (DecodeHeader): Call size_func once the size is known,
	even if the module can't make use of the scaling information. If
	size_func returns 0, don't allocate a pixbuf and return, if
	necessary with an error.

	* gdk-pixbuf.h:
	* gdk-pixbuf-io.c (gdk_pixbuf_get_file_info): A new function
	to determine the type and size of an image file without loading
	it completely.  (#53725)
2004-01-07 00:26:58 +00:00
Matthias Clasen
44c206420a Move the documentation for signals inline, to get proper parameter
Thu Dec 11 01:57:05 2003  Matthias Clasen  <maclas@gmx.de>

	* gdk-pixbuf-loader.c (gdk_pixbuf_loader_class_init): Move
	the documentation for signals inline, to get proper parameter
	documentation.  (#128977)
2003-12-11 00:57:20 +00:00
Matthias Clasen
de07fd2a7e Add gdk_pixbuf_loader_new_with_mime_type.
2003-06-22  Matthias Clasen  <matthias@localhost.localdomain>

	* gdk-pixbuf/gdk-pixbuf-sections.txt: Add gdk_pixbuf_loader_new_with_mime_type.
2003-06-22 19:08:12 +00:00
Matthias Clasen
691a5fd50a Add sanity checks for GError handling. (#108345) 2003-04-24 18:51:07 +00:00
Matthias Clasen
7cb3f99fc7 Document 2.2 API additions. 2002-11-28 00:33:17 +00:00
Matthias Clasen
037a036f84 Reindent 2002-11-05 22:58:28 +00:00
Owen Taylor
8942a3a2d5 Fix leaked pixbuf reference (#96823, Morten Welinder)
Tue Nov  5 14:16:17 2002  Owen Taylor  <otaylor@redhat.com>

        * gdk-pixbuf-loader.c (gdk_pixbuf_loader_close): Fix
        leaked pixbuf reference (#96823, Morten Welinder)
2002-11-05 19:18:56 +00:00
Matthias Clasen
5591c434f8 Documentation updates. 2002-10-11 01:04:45 +00:00
Matthias Clasen
45f7541f42 Support for separately installed loaders. (#77486)
* Makefile.am gdk-pixbuf-animation.c gdk-pixbuf-data.c
	gdk-pixbuf-io.c gdk-pixbuf-io.h gdk-pixbuf-loader.c
	gdk-pixbuf-loader.h gdk-pixbuf-private.h gdk-pixbuf.h
	gdk-pixdata.c io-ani-animation.h io-ani.c io-bmp.c
	io-gif-animation.c io-gif-animation.h io-gif.c io-ico.c
	io-jpeg.c io-png.c io-pnm.c io-ras.c io-tga.c io-tiff.c
	io-wbmp.c io-xbm.c io-xpm.c pixbufloader_ani.def
	pixbufloader_bmp.def pixbufloader_gif.def pixbufloader_ico.def
	pixbufloader_jpeg.def pixbufloader_png.def
	pixbufloader_pnm.def pixbufloader_ras.def pixbufloader_tga.def
	pixbufloader_tiff.def pixbufloader_wbmp.def
	pixbufloader_xbm.def pixbufloader_xpm.def test-gdk-pixbuf.c
	gdk-pixbuf-animation.h queryloaders.c: Support for separately
	installed loaders.  (#77486)
2002-10-03 22:39:51 +00:00
Matthias Clasen
944334da7f Remove the _-prefix from gdk_pixbuf_set_option and
gdk_pixbuf_non_anim_new again.
2002-09-19 21:00:52 +00:00
Matthias Clasen
1e3c6144b4 _-prefix gdk_pixbuf_non_anim_new and gdk_pixbuf_set_option. Adjust all
* io-xpm.c, io-xbm.c, io-ico.c, io-ani.c, io-png.c,
	gdk-pixbuf.c, gdk-pixbuf-animation.c, gdk-pixbuf-loader.c,
	gdk-pixbuf-private.h: _-prefix gdk_pixbuf_non_anim_new and
	gdk_pixbuf_set_option. Adjust all callers.
2002-09-17 22:52:44 +00:00
Matthias Clasen
e4ab381018 Load-at-size functionality for gdk-pixbuf. 2002-07-06 23:10:46 +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
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
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
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
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