summaryrefslogtreecommitdiff
path: root/gdk-pixbuf/io-tga.c
Commit message (Collapse)AuthorAgeFilesLines
* Enable having some gdk-pixbuf loaders built-in even if loading the othersTor Lillqvist2006-10-111-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove unused variable pbuf_count. (#315282, Kjartan Maraas)Matthias Clasen2005-09-051-8/+4
| | | | | | | 2005-09-05 Matthias Clasen <mclasen@redhat.com> * io-tga.c (parse_rle_data): Remove unused variable pbuf_count. (#315282, Kjartan Maraas)
* Fix the update areas for incremental loading of compressed tgas. (#171883,Matthias Clasen2005-03-291-9/+6
| | | | | | | 2005-03-29 Matthias Clasen <mclasen@redhat.com> * io-tga.c (parse_rle_data): Fix the update areas for incremental loading of compressed tgas. (#171883, David Costanzo)
* Changes to make gdk-pixbuf threadsafe (#157310, #157306, Colin Walters):Matthias Clasen2004-11-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* New functions to disable/enable individual loaders and to obtain licenseMatthias Clasen2004-07-081-0/+1
| | | | | | | | | | | | | | | | | | | | | Wed Jul 7 23:53:58 2004 Matthias Clasen <maclas@gmx.de> * gdk-pixbuf-io.h: * gdk-pixbuf-io.c (gdk_pixbuf_format_is_disabled): * gdk-pixbuf-io.c (gdk_pixbuf_format_set_disabled): * gdk-pixbuf-io.c (gdk_pixbuf_format_get_license): New functions to disable/enable individual loaders and to obtain license information about loaders. * gdk-pixbuf-io.h (GdkPixbufFormat): Add disabled and license fields. * gdk-pixbuf-io.c (_gdk_pixbuf_get_module): * gdk-pixbuf-io.c (_gdk_pixbuf_get_named_module): Skip disabled loaders. * io-*.c: Add license information in the fill_info functions.
* Don't use contractions like "don't" or "isn't" in error messages. It isn'tMatthias Clasen2004-06-121-9/+9
| | | | | | | | | Fri Jun 11 22:02:56 2004 Matthias Clasen <maclas@gmx.de> * io-gif.c, io-pnm.c, io-tga.c, io-xpm.c: Don't use contractions like "don't" or "isn't" in error messages. It isn't nice to use them in log entries either... (#137774, Morten Welinder, patch by Alexander Winston)
* Fixes #136082 and #135265, patch by Morten Welinder.Federico Mena Quintero2004-03-061-0/+1
| | | | | | | | | | 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>
* Make it possible to call gdk_pixbuf_loader_set_size (loader, 0, 0) byMatthias Clasen2004-01-071-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* Remove a pointless check. (#122710, Kjartan Maraas)Matthias Clasen2003-09-191-6/+0
| | | | | | | 2003-09-19 Matthias Clasen <maclas@gmx.de> * io-tga.c (try_preload): Remove a pointless check. (#122710, Kjartan Maraas)
* Auxiliary functions used to implement support for arbitrary origins.Matthias Clasen2003-02-181-462/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-02-18 Matthias Clasen <maclas@gmx.de> * io-tga.c (pixbuf_flip_row): (pixbuf_flip_vertically): Auxiliary functions used to implement support for arbitrary origins. (parse_data_for_row_pseudocolor): (parse_data_for_row_truecolor): (parse_data_for_row_grayscale): (parse_data_for_row): (fill_in_context): Remove the check for upper-left origin. (parse_rle_data): Support arbitrary origins. (#105912) * io-tga.c (fread_check): (fseek_check): (get_header_from_file): (get_colormap_from_file): (get_image_pseudocolor): (swap_channels_pixbuf): (get_image_truecolor): (get_image_grayscale): (gdk_pixbuf__tga_load): Remove the non-incremental load implementation, since we have generic_image_load () now. (gdk_pixbuf__tga_stop_load): Fix a potential crash discovered by pixbuf-lowmem.
* Actually reject images with origin not in the upper-left corner. (#105912)Matthias Clasen2003-02-131-5/+3
| | | | | | | | 2003-02-14 Matthias Clasen <maclas@gmx.de> * io-tga.c (try_preload): (gdk_pixbuf__tga_load): Actually reject images with origin not in the upper-left corner. (#105912)
* Support for separately installed loaders. (#77486)Matthias Clasen2002-10-031-8/+38
| | | | | | | | | | | | | | | | | * 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)
* Don't leak memory if g_try_realloc fails.Matthias Clasen2002-09-031-2/+3
| | | | | | | | | * io-tga.c (io_buffer_append): * io-ico.c (DecodeHeader): * io-bmp.c (grow_buffer): Don't leak memory if g_try_realloc fails. * gdk-pixbuf-io.c (pixbuf_check_ico): Fix loading of .CUR files. (#91826)
* Load-at-size functionality for gdk-pixbuf.Matthias Clasen2002-07-061-1/+2
|
* More fixes for #77807:Matthias Clasen2002-04-111-51/+36
| | | | | | | | | | | | | | | | * 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.
* Avoid a double free error if reading the colormap fails.Matthias Clasen2002-03-211-11/+12
| | | | | | | | * 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.
* Fix assumptions on rowstride by manually allocating a contiguous pixelMatthias Clasen2002-03-181-71/+231
| | | | | | | * 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).
* Add a (#ifdef 0'ed) test provoking a segfault in TIFFReadDirectory().Matthias Clasen2002-02-121-0/+14
| | | | | | | | | | | | | | | | | * 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.
* Enable some tests which should work now.Matthias Clasen2002-02-101-2/+10
| | | | | | | | | | | | | | * 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.
* Remove assorted G_OBJECT casts where unnecessary.Sebastian Wilhelmi2001-12-131-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-12-13 Sebastian Wilhelmi <wilhelmi@ira.uka.de> * gdk-pixbuf-animation.c, gdk-pixbuf-loader.c, gdk-pixpuf.c, io-gif-animation.c, io-gif.c, io-tiff.c, test-loaders.c: Remove assorted G_OBJECT casts where unnecessary. * gdk-pixbuf-loader.c: Call g_object_ref and g_object_unref instead of gdk_pixbuf_animation_ref and gdk_pixbuf_animation_unref resp. * gdk-pixbuf-csource.c, io-bmp.c, io-gif-animation.c, io-ico.c, io-jpeg.c, io-png.c, io-pnm.c, io-ras.c, io-tga.c, io-wbmp.c, io-xbm.c, io-xpm.c, test-gdk-pixbuf.c: Dito for gdk_pixbuf_ref and gdk_pixbuf_unref. * Makefile.am, pixops/Makefile.am: Compile everything with -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED * gdk-pixdata.c: Use g_ascii_strup() instead of g_strup(). * io-xpm.c: Use g_ascii_strcasecmp() instead of g_strcasecmp(). * demos/testpixbuf-drawable.c, demos/testpixbuf-save.c, demos/testpixbuf-scale.c, demos/testpixbuf.c: Call g_object_ref and g_object_unref instead of gdk_pixbuf_ref and gdk_pixbuf_unref resp.
* Robustness fixes and test images for the jpeg, tiff, pnm, gif, xpm and tgaMatthias Clasen2001-09-141-1/+13
| | | | loaders.
* Add tga loader, patch by Nicola Girardi. (#56067)Matthias Clasen2001-08-211-0/+1162