Commit Graph

148 Commits

Author SHA1 Message Date
Matthias Clasen
54000d0ede Bug 566862 – pixbuf_new_from_file does not autodetect format
2009-01-07  Matthias Clasen  <mclasen@redhat.com>

        Bug 566862 – pixbuf_new_from_file does not autodetect format

        * gdk-pixbuf-io.c (_gdk_pixbuf_get_module): Go back to sniffing
        without looking at the filename, to avoid breaking expected
        functionality.


svn path=/trunk/; revision=22073
2009-01-07 15:02:33 +00:00
Matthias Clasen
661fbdfa26 Plug a small memory leak
svn path=/trunk/; revision=21451
2008-09-19 14:34:22 +00:00
Tor Lillqvist
4125df1d8e gdk-pixbuf/gdk-pixbuf-io.c Don't use the deprectated
2008-09-13  Tor Lillqvist  <tml@novell.com>

	* gdk-pixbuf/gdk-pixbuf-io.c
	* gtk/gtkmain.c: Don't use the deprectated
	g_win32_get_package_installation_directory() and
	g_win32_get_package_installation_subdirectory() functions. Use
	g_win32_get_package_installation_directory_of_module()
	instead. Also, don't use the deprecated silly
	G_WIN32_DLLMAIN_FOR_DLL_NAME macro, but an explicit minimal
	DllMain() that just saves the DLL handle.


svn path=/trunk/; revision=21381
2008-09-13 19:31:29 +00:00
Tor Lillqvist
b2dff511d3 gdk-pixbuf/gdk-pixbuf-io.c Do as the docs for
2008-09-13  Tor Lillqvist  <tml@novell.com>

	* gdk-pixbuf/gdk-pixbuf-io.c
	* gtk/gtkmain.c: Do as the docs for
	g_win32_get_package_installation_directory() say and pass NULL as
	the first parameter.


svn path=/trunk/; revision=21379
2008-09-13 09:19:03 +00:00
Matthias Clasen
ef5855feb1 Another small leak
svn path=/trunk/; revision=21316
2008-09-08 02:39:38 +00:00
Matthias Clasen
d8f4295267 Plug a small memory leak in an error path
svn path=/trunk/; revision=21313
2008-09-07 21:37:34 +00:00
Sebastien Bacher
1e3251a26e bug 550969 - fix a typo which breaks the static build
2008-09-05  Sebastien Bacher  <seb128@ubuntu.com>

	* gdk-pixbuf-io.c: (gdk_pixbuf_load_module_unlocked):
	bug 550969 - fix a typo which breaks the static build

svn path=/trunk/; revision=21303
2008-09-05 20:52:40 +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
Matthias Clasen
266e482286 Bug 549711 – Race condition when loading gdk-pixbuf image modules
2008-09-03  Matthias Clasen  <mclasen@redhat.com>

        Bug 549711 – Race condition when loading gdk-pixbuf image modules

        * gdk-pixbuf-io.c: Fix a race condition in module loading,
        spotted by Chris Lord.


svn path=/trunk/; revision=21268
2008-09-03 23:12:55 +00:00
Matthias Clasen
e0d3046a7e Fix a typo
svn path=/trunk/; revision=21220
2008-08-28 03:49:25 +00:00
Matthias Clasen
830a9d2710 More correct content type handling
svn path=/trunk/; revision=20897
2008-07-23 04:20:15 +00:00
Matthias Clasen
1ea43444be test content sniffing capability of gio
svn path=/trunk/; revision=20837
2008-07-15 16:33:24 +00:00
Matthias Clasen
e67da00f16 Improve docs for gdk_pixbuf_new_from_file_at_scale(). Proposed by Juan
* gdk-pixbuf-io.c: Improve docs for gdk_pixbuf_new_from_file_at_scale().
        Proposed by Juan Manuel Palacios


svn path=/trunk/; revision=20828
2008-07-15 02:26:16 +00:00
Matthias Clasen
cf793d109e Use GIO for sniffing image types, except on Win32, where GIO doesn't do
2008-07-11  Matthias Clasen  <mclasen@redhat.com>

        * gdk-pixbuf-io.c: Use GIO for sniffing image types, except
        on Win32, where GIO doesn't do any sniffing.


svn path=/trunk/; revision=20820
2008-07-12 02:37:35 +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
Christian Persch
446f41757b Use g_set_error_literal where appropriate. Bug #538640.
svn path=/trunk/; revision=20463
2008-06-19 12:47:48 +00:00
Matthias Clasen
9038f2ce98 Bug 535453 - gdk_pixbuf_format_get_license returns NULL for
any of the loaders

        * queryloaders.c (write_loader_info): Add the license info
        after the description.

        * gdk-pixbuf-io.c (gdk_pixbuf_io_init): Read the license info
        from the module file. Reported by Andrey Tsyvarev.


svn path=/trunk/; revision=20241
2008-05-29 21:04:52 +00:00
Tor Lillqvist
59596e699f Use explicit G_MODULE_EXPORT decoration when building the loader in
2008-05-27  Tor Lillqvist  <tml@novell.com>

	* io-*.c: Use explicit G_MODULE_EXPORT decoration when building
	the loader in question as a module.

	* gdk-pixbuf-io.c: Enable included build of the icns and jasper
	loaders.


svn path=/trunk/; revision=20192
2008-05-27 16:51:33 +00:00
Björn Lindqvist
8fce9eab79 Guard against NULL pointer. (#467051, Gian Mario Tagliaretti)
2008-03-23  Björn Lindqvist  <bjourne@gmail.com>

	* gdk-pixbuf/gdk-pixbuf-io.c (gdk_pixbuf_new_from_xpm_data): Guard
	against NULL pointer. (#467051, Gian Mario Tagliaretti)


svn path=/trunk/; revision=19929
2008-03-23 18:27:03 +00:00
Tor Lillqvist
6d15bbbe1d Import the GDI+ gdk-pixbuf loaders for Windows by Dominic Lachowicz and
2008-03-21  Tor Lillqvist  <tml@novell.com>

	Import the GDI+ gdk-pixbuf loaders for Windows by Dominic
	Lachowicz and Alberto Ruiz into the GTK+ tree, from the
	gdip-pixbuf-loader module.

	* configure.in: Add switch --disable-gdiplus-loaders that disables
	building of the GDI+ loaders.

	When including loaders in the gdk-pixbuf library, either build in
	abll the GDI+ ones or none of them. Use just -DINCLUDE_gdiplus in
	$INCLUDED_LOADER_DEFINE to signal building them in.

	Add Automake conditionals BUILD_GDIPLUS_LOADERS to indicate
	whether the GDI+ loaders should be built and INCLUDE_GDIPLUS to
	indicate whether they should be built-in.
	
	For the rest of the changes, see gdk-pixbuf/ChangeLog.

	In gdk-pixbuf:

	* Makefile.am: Add the bits and pieces for the GDI+ loaders. When
	building GDI+ loaders don't build the traditional ones for the
	same formats. Always build the traditional PNG loader, though, as
	it isn't possible to read and write PNG tEXt chunks through GDI+,
	and GIMP at least needs that functionality in the gdk-pixbuf PNG
	loader. 

	Either build all the GDI+ loaders (except the PNG one) into
	libgdk-pixbuf, or build them all as DLLs. I don't see any reason
	to enable cherry-picking among them whether to build in or not.

	* io-gdip-animation.c
	* io-gdip-animation.h
	* io-gdip-bmp.c
	* io-gdip-emf.c
	* io-gdip-gif.c
	* io-gdip-ico.c
	* io-gdip-jpeg.c
	* io-gdip-native.h
	* io-gdip-png.c
	* io-gdip-propertytags.h
	* io-gdip-tiff.c
	* io-gdip-utils.c
	* io-gdip-utils.h
	* io-gdip-wmf.c: New files. Note that io-gdip-png.c is not
	currently used.

	* gdk-pixbuf-io.c: Add the bits and pieces for built-in GDI+
	loaders.


svn path=/trunk/; revision=19914
2008-03-20 23:24:45 +00:00
Matthias Clasen
45e33fe9c2 Go back to 2.13.0 as version for now, as there was no consensus to do the
2008-02-15  Matthias Clasen  <mclasen@redhat.com>

        * configure.in: Go back to 2.13.0 as version for now,
        as there was no consensus to do the jump.

        * many other places: Update Since: tags.



svn path=/trunk/; revision=19586
2008-02-15 23:42:42 +00:00
Matthias Clasen
0eb4770cfa Don't let the width or height go below 1. (#516024, Christian Persch)
2008-02-12  Matthias Clasen  <mclasne@redhat.com>

        * gdk-pixbuf-io.c (at_scale_size_prepared_cb): Don't let
        the width or height go below 1.  (#516024, Christian Persch)



svn path=/trunk/; revision=19534
2008-02-12 16:35:02 +00:00
Matthias Clasen
00a56fc2ab Handle partial writes.
2008-01-15  Matthias Clasen  <mclasne@redhat.com>

        * gdk-pixbuf-io.c (save_to_stream): Handle partial writes.



svn path=/trunk/; revision=19380
2008-01-16 17:38:13 +00:00
Michael Natterer
7932cfb669 fix signature of this function and propagate errors from
2008-01-16  Michael Natterer  <mitch@imendio.com>

	* gdk-pixbuf-io.c (save_to_stream): fix signature of this function
	and propagate errors from g_output_stream_write(). Return error
	also on incomplete writes (which don't generate an error by
	themselves).

	Unrelated:

	(gdk_pixbuf_io_init): initialize "builtin_module" on a separate
	line to avoid compiler warning in the common case of no built-in
	modules.


svn path=/trunk/; revision=19378
2008-01-16 14:35:46 +00:00
Matthias Clasen
65cdbb25a8 Add stream i/o functions for gdk-pixbuf
svn path=/trunk/; revision=19373
2008-01-16 02:24:47 +00:00
Tor Lillqvist
f6783c7466 Enable having some gdk-pixbuf loaders built-in even if loading the others
2006-10-11  Tor Lillqvist  <tml@novell.com>

	* configure.in: Enable having some gdk-pixbuf loaders built-in
	even if loading the others dynamically. Define Automake
	conditional INCLUDE_FOO for each loader as TRUE if that loader is
	built-in. See also gdk-pixbuf/ChangeLog.

2006-10-11  Tor Lillqvist  <tml@novell.com>

	Enable having some loaders built-in even if loading the others
	dynamically. Have loaders in the same order as in configure.in in
	all places where they are handled/listed.

	* Makefile.am: Define the STATIC_FOO_LIB and FOO_LIB macros
	conditionally depending on whether said loader is built-in or
	not. Use the names libstatic-pixbufloader-foo.la instead of
	libpixbufloader-static-foo.la for the built-in ones so that the
	"echo libpixbufloader-*.la" won't match them.

	* gdk-pixbuf-io.c: Reorganize code as to plumb the built-in
	loaders also if USE_GMODULE. Don't warn about a missing
	gdk-pixbuf.loaders file if we have at least one included loader.

	* gdk-pixbuf-private.h
	* io-*.c: Don't define a generic MODULE_ENTRY, as we can't use it
	in the loaders anyway. Each loader needs to check if INCLUDE_foo
	is defined.
2006-10-11 12:41:14 +00:00
Matthias Clasen
241ff0b6bd Cleanups 2006-10-08 05:32:07 +00:00
Matthias Clasen
f45a35921a Commit a patch by Behdad to fix typos, omissions and other errors in the
2006-09-10  Matthias Clasen  <mclasen@redhat.com>

        * Commit a patch by Behdad to fix typos, omissions and other
        errors in the symbol aliasing, and add checks for local PLT
        entries.  (#354687, Behdad Esfahbod)
2006-09-10 06:39:16 +00:00
Matthias Clasen
b34a2576d1 Stop loading an animation if the first frame is complete. (#350911,
2006-08-16  Matthias Clasen  <mclasen@redhat.com>

	* gdk-pixbuf-io.c (gdk_pixbuf_new_from_file_at_scale):
	Stop loading an animation if the first frame is complete.
	(#350911, Christian Neumair)
2006-08-16 06:01:09 +00:00
Matthias Clasen
2d281ed53d Always save errno to a temporary before making other calls. (#335179,
2006-03-20  Matthias Clasen  <mclasen@redhat.com>

        * gdk-pixbuf-animation.c:
        * gdk-pixbuf-io.c:
        * io-xpm.c:
        * io-xbm.c:
        * io-gif.c: Always save errno to a temporary before making
        other calls.  (#335179, Morten Welinder)
2006-03-20 20:09:51 +00:00
Anders Carlsson
38089f4344 Update documentation now that tiff supports saving.
2006-02-28  Anders Carlsson  <andersca@imendio.com>

        * gdk-pixbuf-io.c:
        Update documentation now that tiff supports saving.

        * io-tiff.c:
        (tiff_load_read):
        (tiff_load_write):
        (tiff_load_seek):
        (tiff_load_close):
        (tiff_load_size):
        (tiff_load_map_file):
        (tiff_load_unmap_file):
        (gdk_pixbuf__tiff_image_stop_load):
        Rename callback functions that are used during loading.

        (tiff_save_read):
        (tiff_save_write):
        (tiff_save_seek):
        (tiff_save_close):
        (tiff_save_size):
        (create_save_context):
        (free_save_context):
        New callback functions which operate on a memory buffer.

        (gdk_pixbuf__tiff_image_save_to_callback):
        Implement saving of pixbufs to tiffs.

        (save_to_file_cb):
        (gdk_pixbuf__tiff_image_save):
        New function that saves a pixbuf to a FILE handle. Uses
        save_to_callback.

        (fill_vtable):
        Add new functions.

        (fill_info):
        Change flags since this module supports writing now.
2006-02-28 09:48:49 +00:00
Jonathan Blandford
4faad6e726 minor doc edit 2005-12-30 06:02:04 +00:00
Matthias Clasen
0a876523eb Use G_MODULE_BIND_LAZY when opening modules.
2005-12-16  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilesystem.c (gtk_file_system_module_load):
	* gtk/gtkimmodule.c (gtk_im_module_load):
	* gtk/gtkthemes.c (gtk_theme_engine_load):
	* gtk/gtkmodules.c (find_module): Use G_MODULE_BIND_LAZY when
	opening modules.
2005-12-16 19:06:09 +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
a4b3c35828 Make this work again.
2005-08-30  Matthias Clasen  <mclasen@redhat.com>

	* gdk-pixbuf-io.c (format_check): Make this work again.
2005-08-30 16:55:49 +00:00
Matthias Clasen
0aa27306aa Add a cast to avoid compiler warnings.
2005-08-30  Matthias Clasen  <mclasen@redhat.com>

	* io-png.c (png_save_to_callback_write_func): Add a cast
	to avoid compiler warnings.

	* pixops/timescale.c (main): Declare src_buf, dest_buf as
	unsigned to avoid compiler warnings.

	* gdk-pixbuf-io.h: Declare the prefix and mask members of
	GdkPixbufModulePattern as char*, to avoid compiler warnings.

	* io-ani.c (ani_load_chunk): Use g_try_new() in some places.
2005-08-30 15:07:12 +00:00
Matthias Clasen
da260ce835 Make anchored patterns work as they did before.
2005-07-22  Matthias Clasen  <mclasen@redhat.com>

	* gdk-pixbuf-io.c (format_check): Make anchored patterns work
	as they did before.
2005-07-22 15:34:32 +00:00
Matthias Clasen
804083681e Interpret patterns where the first byte of the mask is '*' as unanchored.
2005-07-22  Matthias Clasen  <mclasen@redhat.com>

	* gdk-pixbuf-io.c (format_check): Interpret patterns where
	the first byte of the mask is '*' as unanchored.  (#311011)
	(gdk_pixbuf_new_from_file): Use the first 256 bytes for
	sniffing the file format.
2005-07-22 04:37:27 +00:00
Matthias Clasen
e1e07ce4f1 Allow -1 for width/height and interpret them as "not constrained".
2005-07-01  Matthias Clasen  <mclasen@redhat.com>

	* gdk-pixbuf-io.c (gdk_pixbuf_new_from_file_at_scale): Allow
	-1 for width/height and interpret them as "not constrained".
	(#309258, Mark McLoughlin)
2005-07-01 16:52:33 +00:00
Sven Neumann
3bc682d012 allow to specify the PNG compression level by passing a "compression"
2005-05-24  Sven Neumann  <sven@gimp.org>

	* io-png.c: allow to specify the PNG compression level by passing
	a "compression" parameter to the PNG save function (bug #305337).

	* gdk-pixbuf-io.c (gdk_pixbuf_save): document the new parameter.
2005-05-24 17:09:56 +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
Tor Lillqvist
f40bcdcfc5 gdk-pixbuf-core.h gdk-pixbuf-io.c Implement DLL ABI stablility for
2005-03-10  Tor Lillqvist  <tml@novell.com>

	* gdk-pixbuf-core.h
	* gdk-pixbuf-io.c
	* gdk-pixbuf.symbols: Implement DLL ABI stablility for
	gdk_pixbuf_save() and gdk_pixbuf_savev(). (#167973)
2005-03-10 19:13:19 +00:00
Matthias Clasen
534d584ba6 Document BMP saving support.
2005-02-23  Matthias Clasen  <mclasen@redhat.com>

	* gdk-pixbuf-io.c: Document BMP saving support.

	* io-bmp.c: Support saving as BMP. (168173, Ivan Wong)
2005-02-24 04:41:35 +00:00
Tor Lillqvist
6ba75ff95b gdk-pixbuf-animation.c gdk-pixbuf-io.c io-xbm.c io-xpm.c
2004-12-05  Tor Lillqvist  <tml@iki.fi>

	* gdk-pixbuf-animation.c
	* gdk-pixbuf-io.c
	* io-xbm.c
	* io-xpm.c
	* make-inline-pixbuf.c
	* queryloaders.c: Use gstdio wrappers. Document that file names
	are in the GLib file name encoding.

	* gdk-pixbuf-csource.c
	* queryloaders.c: On Windows, convert command line arguments and
	environment variable values from locale encoding to UTF-8.

	* queryloaders.c: On Windows, use wide character API when
	available.

	* Makefile.am
	* gdk-pixbuf-core.h
	* gdk-pixbuf-io.c
	* gdk-pixbuf-animation.h
	* gdk-pixbuf-animation.c: Like in GLib, for DLL ABI stability on
	Windows, add binary compatibility versions of functions that take
	file names as arguments. They use the system codepage, not GLib
	file name encoding (which is UTF-8 on Windows). Use #defines to
	make newly compiled code use the "real" functions that use the
	GLib file name encoding scheme.
2004-12-05 12:43:47 +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
9e847e411f Don't use _gdk_pixbuf_load_module_unlocked() in the !USE_GMODULE case.
2004-11-12  Matthias Clasen  <mclasen@redhat.com>

	* gdk-pixbuf-io.c (gdk_pixbuf_io_init): Don't use
	_gdk_pixbuf_load_module_unlocked() in the !USE_GMODULE case.
2004-11-12 20:43:08 +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
2b080cc294 Use g_filename_display_name() instead of g_filename_to_utf8() when putting
2004-11-10  Matthias Clasen  <mclasen@redhat.com>

	* gdk-pixbuf-animation.c:
	* gdk-pixbuf-io.c: Use g_filename_display_name() instead of
	g_filename_to_utf8() when putting filenames in error messages.
2004-11-11 03:12:25 +00:00
Matthias Clasen
d5f92150d4 Fix many sparse warnings. 2004-10-28 15:00:05 +00:00
Matthias Clasen
cd50f460a5 Add gdk_pixbuf_new_from_file_at_scale(), which is just like
Thu Aug 26 01:23:16 2004  Matthias Clasen  <maclas@gmx.de>

	* gdk-pixbuf-core.h:
	* gdk-pixbuf.symbols:
	* gdk-pixbuf-io.c (gdk_pixbuf_new_from_file_at_scale):
	Add gdk_pixbuf_new_from_file_at_scale(), which is just
	like gdk_pixbuf_new_from_file_at_size(), but optionally
	ignores the aspect ratio.  (#136395, Dom  Lachowicz)
2004-08-26 05:33:13 +00:00