summaryrefslogtreecommitdiff
path: root/gdk-pixbuf
Commit message (Collapse)AuthorAgeFilesLines
* windows: Remove old codepage ABI compat codeChristoph Reiter2016-11-074-155/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (and as a side effect make the gi bindings API compatible with other platforms) The compat code was added in https://git.gnome.org/browse/gdk-pixbuf/commit/?id=141506eb46927eb10b74bc24727488bdbde1c7d4 to allow switching to utf-8 paths while keeping binary compatibility and to make new programs link against the "_utf8" variants. This results in two problems for gi bindings: (1) g-ir-scanner can't find the annotations due to the renames and thus gdk_pixbuf_savev() can't be used in bindings (the other functions happen to work with default annotations) (2) g-ir-scanner will write the renamed functions in the gir/typelib with the "_utf8" suffix, making the resulting bindings API incompatible with other platforms. Some months ago https://git.gnome.org/browse/gdk-pixbuf/commit/?id=6855a2d806b2305938abc04b0cb4fa383f8ccd3b got rid of symbol files, breaking ABI and old binaries. This patch removes the, now unused, codepage code and removes the renames so that new code links against the real functions again. To not break recent binaries add new functions with the _utf8 suffix which just call the main functions. Annotations are copied as well to not break bindings API. A similar change in glib was commited some years ago https://git.gnome.org/browse/glib/commit/?id=8c42a663f8182f8281c083390aa761e8e9badc63 https://bugzilla.gnome.org/show_bug.cgi?id=773760
* Avoid undefined behaviorDhiru Kholia2016-09-121-3/+3
| | | | | | | | Doing overflow checks with signed integers invokes undefined behavior and induces modern compilers to omit the checks altogether. Avoid this by doing the overflow check with unsigned integers. https://bugzilla.gnome.org/show_bug.cgi?id=770986
* Fix a typoMatthias Clasen2016-09-121-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=770756
* ico: Be more careful when parsing headersMatthias Clasen2016-08-031-58/+78
| | | | | | | | | | | | | There is some redundancy between the ico directory and the bitmap image header. If the two disagree on the icon dimensions, just toss the image, instead of risking crashes or OOM later. Also add some more debug spew that helped in tracking this down, and make error messages more unique. The commit also includes a test image that has an example of this discrepancy and triggers the early exit. https://bugzilla.gnome.org/show_bug.cgi?id=769170
* modules: implement is_option_supported() for builtin modulesMatthias Clasen2016-08-026-0/+72
| | | | | | | Follow-up to previous commit; implement the new API in the modules we ship that can save pixbufs. https://bugzilla.gnome.org/show_bug.cgi?id=683371
* gdk-pixbuf: add gdk_pixbuf_format_is_save_option_supported() APICosimo Cecchi2016-08-022-3/+42
| | | | | | | This is useful when you want to set an option (e.g. icc-profile) that might be supported by different formats, but not all of them. https://bugzilla.gnome.org/show_bug.cgi?id=683371
* Fix gettext useStanislav Brabec2016-08-021-1/+1
| | | | | | gettext() calls inside library have to use gi18n-lib.h. https://bugzilla.gnome.org/show_bug.cgi?id=758552
* bmp: Detect integer overflow of the line widthTobias Mueller2016-08-021-9/+12
| | | | | | | | | | Instead of risking crashes or OOM, return an error if we detect integer overflow. The commit also includes a test image that triggers this overflow when used with pixbuf-read. https://bugzilla.gnome.org/show_bug.cgi?id=768738
* gdk-pixbuf: Make set_option() usable in client codeBastien Nocera2016-08-022-7/+5
| | | | | | Not just in loaders. https://bugzilla.gnome.org/show_bug.cgi?id=768043
* gdk-pixbuf: Mention copy_options() in copy()Bastien Nocera2016-08-021-1/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=768043
* gdk-pixbuf: Add gdk_pixbuf_remove_option() helperBastien Nocera2016-08-022-0/+69
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=768043
* gdk-pixbuf: Add gdk_pixbuf_copy_options() helperBastien Nocera2016-08-022-0/+43
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=768043
* Drop unneeded use of deprecated GLib thread APIMatthias Clasen2016-08-021-10/+2
| | | | | Threads have always been initializes, since 2011. Time to drop this.
* io-xpm: Fix "format not a string literal" errorsBastien Nocera2016-08-021-8/+9
| | | | | | With GCC 6.1 and newer. https://bugzilla.gnome.org/show_bug.cgi?id=768042
* ico: Always set errorsHanno Boeck2016-08-021-2/+12
| | | | | | | | | | When the ico header turn out to be bad, always set an error when we fail. Otherwise, applications will get confused. This commit also adds an example image with a bad ico header. https://bugzilla.gnome.org/show_bug.cgi?id=768484
* bmp: Fix an integer overflow in DecodeColormapTobias Mueller2016-08-021-3/+12
| | | | | | | | | | Return an error if n_colors * samples overflows. This commit also adds a reproducer that will cause pixbuf-randomly-modified to crash in the absence of the patch. https://bugzilla.gnome.org/show_bug.cgi?id=768688
* Fix version number variable linkageChun-wei Fan2016-06-142-6/+6
| | | | | | | | When we used compiler directives to export symbols, we must also define GDK_PIXBUF_VAR accordingly, so that the version number variables get exported properly. Please see https://bugzilla.gnome.org/show_bug.cgi?id=767164#c8
* gdk-pixbuf: Use compiler directives to export symbolsChun-wei Fan2016-06-074-285/+8
| | | | | | | | | | | | | | Like what is now done in GLib, ATK, GTK+ and some other libraries, make use of compiler directives that is determined at configure stage (or pre-configured) to export the symbols for the GdkPixbuf library. This cleans up things a bit, as the .symbols file will no longer need to be maintained, as long as the GDK_PIXBUF_AVAILABLE_IN_* (or so) annotation is marked in the header and the source file that defines the function has config.h included first. Clean up configure.ac and gdk-pixbuf/Makefile.am a bit as a result. https://bugzilla.gnome.org/show_bug.cgi?id=767164
* Add version macro headerChun-wei Fan2016-06-0711-16/+797
| | | | | | | | | | | | | Add a version macro header that would reveal the availability of the various APIs, which is used to indicate what stable release series an API is available, and what release series is an API deprecated. This is also used to export the symbols using compiler directives, which would eliminate the need to maintain .symbols files. Annotate the symbols in the pubic headers accordingly, and update the doc sections file so that the macros are included in the documentation. https://bugzilla.gnome.org/show_bug.cgi?id=767164
* Fix bug 766842Daniel Trebbien2016-05-311-13/+42
| | | | | | | | | | | | This commit fixes an issue where pixops_composite_nearest_noscale () had different behavior than pixops_composite_nearest () for pixels in the destination that are not a part of the transformed source image. Per the documentation, the pixels at the edges of the source image should be replicated to infinity. Added a test to tests/pixbuf-composite.c https://bugzilla.gnome.org/show_bug.cgi?id=766842
* Avoid redundant property notificationMatthias Clasen2016-05-041-0/+18
| | | | | We were emitting ::notify even for properties which have only one possible value.
* MSVC Builds: Generate the Introspection CommandsChun-wei Fan2016-04-141-2/+29
| | | | | | | | | | | | | Use the autotools module that was added in the previous commit so that we can use it to generate the file list for introspection at 'make dist', as well as the command lines for g-ir-scanner and g-ir-compiler to generate the .gir files and to compile the .typelib files. This also makes detectenv-msvc.mak and introspection-msvc.mak generic so that they may be respectively updated from $(glib_srcroot)/build/win32 and $(gi_srcroot)/build/win32, as they are now copies of them. https://bugzilla.gnome.org/show_bug.cgi?id=765034
* Add non-varargs versions of methods to save to streamCosimo Cecchi2016-04-063-34/+134
| | | | | | | | This is useful when the set of options you want to use changes according to specific conditions, and makes the stream-based API consistent with the others. https://bugzilla.gnome.org/show_bug.cgi?id=683063
* bmp: Reject impossible palette sizeMatthias Clasen2015-12-051-0/+11
| | | | | | | | | bmp headers contain separate fields for the number of colors, and the bit depth. Catch the impossible n_colors > 1 << depth and error early, before it causes a out-of-bounds memory access when decoding the colormap. https://bugzilla.gnome.org/show_bug.cgi?id=758991
* bmp: Reject bogus depthMatthias Clasen2015-12-051-0/+9
| | | | | | | | Erroring out early if we find a bogus image depth is the right thing to do, and avoids possible memory overruns later on. https://bugzilla.gnome.org/show_bug.cgi?id=747605
* TGA: Always build gdk-pixbuf-buffer-queue.cChun-wei Fan2015-10-231-1/+1
| | | | | | The gdk-pixbuf-buffer-queue.c is built when the TGA loader is built as a loader module, but is not built when the TGA loader is built directly into the main GDK-Pixbuf library. Fix that, to avoid linker errors.
* tga: Error on incomplete imageBenjamin Otte2015-10-131-10/+12
| | | | | | | Previously, we would silently ignore the case where the image didn't have enough pixels. That is not a good idea, in particular when we haven't even read a header.
* ico: Add all mime types from shared-mime-infoBenjamin Otte2015-10-131-0/+5
| | | | In particular, add the canonical image/vnd.microsoft.icon
* ico: Protect against overflowBenjamin Otte2015-10-131-15/+17
|
* tga: Only check for as many pixels as are actually neededBenjamin Otte2015-10-131-2/+2
|
* tga: Fill remaining pixels when closing incompletely loaded imageBenjamin Otte2015-10-131-0/+11
| | | | | This way, the images are neatly transparent/black instead of random colors.
* tga: Error out if a pseudocolor image comes without colormapBenjamin Otte2015-10-131-0/+11
|
* tga: Use new tga_pixels_remaining() in rle loaderBenjamin Otte2015-10-131-4/+2
|
* tga: Redo colormap handlingBenjamin Otte2015-10-131-50/+58
| | | | | | | | | Always allocate a colormap struct, but only parse colors into the colormap if the has_colormap flag is set in the header. Allocating the colormap is important to not get failures when people provide broken images - like a header indicating a pseudocolor image but without a colormap.
* tga: Support 16bpp imagesBenjamin Otte2015-10-131-7/+22
|
* tga: Set different process funcs for rle dataBenjamin Otte2015-10-131-32/+19
| | | | | Instead of using the same process func that only does an if (rle) switch.
* tga: Don't read data row-by-rowBenjamin Otte2015-10-131-28/+17
| | | | Instead, just read as much data as is available.
* tga: Unify data reading functionsBenjamin Otte2015-10-131-210/+25
| | | | | We don't have to differentiate between grayscale, truecolor and colormapped anymore. The read_pixel function does that now.
* tga: Add tga_read_pixel() function and use it.Benjamin Otte2015-10-131-27/+57
|
* tga: Use gdk_pixbuf_new ()Benjamin Otte2015-10-131-32/+1
| | | | We don't need contiguous pixbufs anymore.
* tga: Split out a functionBenjamin Otte2015-10-131-36/+33
| | | | | Simplifies code and thereby makes it clearer which formats are supported.
* tga: Add tga_write_pixel() functionBenjamin Otte2015-10-131-150/+91
| | | | | | This unifies writing of pixels across all the different image data parsers. In particular it takes care of doing flipped images properly.
* tga: Get rid of done variableBenjamin Otte2015-10-131-37/+16
|
* tga: Refactor row parsingBenjamin Otte2015-10-131-62/+75
| | | | | Read the bytes where they are needed, not before. This way we get rid of the rowstride variable.
* tga: Refactor state machineBenjamin Otte2015-10-131-132/+163
| | | | | Instead of keeping lots of flags, just keep a function pointer and reassign to a new function whenever state changes.
* tga: Don't care about extra data at end of fileBenjamin Otte2015-10-131-9/+1
| | | | | It's called the "extension area" and people are free to put random stuff there. So don't error out if they do.
* tga: Port to GdkPixbufBufferQueueBenjamin Otte2015-10-131-312/+239
|
* Add GdkPixbufBufferQueueBenjamin Otte2015-10-133-1/+420
| | | | Taking heavy inspiration from Swfdec here.
* pixops: use gint64 in more places to avoid overflow when shiftingMike Gorse2015-10-061-17/+17
|
* gif: Fix thumbnailing GIF animationsBastien Nocera2015-10-052-3/+12
| | | | | | | | | | | | | When using progressive loading, the GIF loader seems to expect us to load every single frame of the image before being "done". That's really not the case when thumbnailing, as we only want the first frame in that case. Return the GDK_PIXBUF_ERROR_INCOMPLETE_ANIMATION error when not all the frames have been decoded, so that users of the API can ignore it, like gnome-desktop's thumbnailer. https://bugzilla.gnome.org/show_bug.cgi?id=755672