Commit Graph

2073 Commits (7ee4ca2aa0f1966976d3b22885b82d480249e8a4)

Author SHA1 Message Date
Pierre Joye 7ee4ca2aa0
Update email
Once we have mail server or list (private for this and sec), can add one for this
2021-07-16 18:15:56 +07:00
Mike Frysinger bf36fa539b use https://libgd.org 2021-07-05 23:59:35 -04:00
Pierre Joye 6c77c34e44
Update README.md 2021-07-05 10:43:46 +07:00
Mike Frysinger 557d4fa167 use https://lib.gd 2021-05-28 22:40:52 -04:00
Mike Frysinger 19c7a5d651 use gdIOCtxPtr more consistently
We have gdIOCtxPtr for gdIOCtx*, so switch the public headers to it
consistently.
2021-05-28 21:19:20 -04:00
Mike Frysinger df8f989825 use malloc compiler attribute if available
This informs the compiler that these functions return allocated
memory.  That allows it to make some optimization decisions which
can produce better code.
2021-05-28 15:47:37 -04:00
Mike Frysinger 968ba1132d gd_strtok: constify delimiter 2021-05-28 15:45:06 -04:00
Ben Morss 5c55da917d avifMalloc => avifAlloc 2021-05-26 22:19:31 -04:00
Mike Frysinger d6baf4c5c9 gdft: fix image pointer types
These are equiv, but switch them over for clarity & consistency.
2021-05-26 20:12:50 -04:00
Mike Frysinger c44cb824de
Merge pull request #701 from morsssss/master
These are inspired by the work I've done to propagate libgd's AVIF support into
PHP's bundled gd fork.

One of these changes fixes a small memory leak.

In the other - in the original PR, I hadn't realized that gd_error() outputs a
LOG_WARNING. I use gd_error() throughout gd_avif.c, except for the case where
we notice that an image's color profile isn't sRGB. This message is significant,
but not as much as the errors that occur when we can't process the user's
request at all. So I'd explicitly used LOG_WARNING.

That makes no sense, though, if we'd be outputting a LOG_WARNING level anyway!
So I've just downgraded this one to LOG_NOTICE.

Others will have more experience than I do with libgd error levels; I'd
cheerfully defer to them here.
2021-05-26 13:05:26 -04:00
Ben Morss 255e7bd97e Downgrade WARNING error to NOTICE
I hadn't realized that gd_error() output a LOG_WARNING. I don't think this error is as significant as the errors that occur when we can't process the user's request at all.
2021-05-26 11:25:56 -04:00
Ben Morss cba26d7fc6 Fix memory leak
libavif will use this function as a callback.
Using libavif's memory allocators gives libavif a chance to release this memory when it's finished with it.
2021-05-26 11:21:46 -04:00
Mike Frysinger 82d2609505 merge duplicate COPYING files
The toplevel COPYING had one small bit missing that src/COPYING had,
so move that over and delete the duplicate.
2021-04-24 23:58:06 -04:00
Mike Frysinger 19d81dd3c7 getver: tweak awk for macOS
Maybe macOS wants a space after the -v option.
2021-04-24 23:46:25 -04:00
Mike Frysinger c6af75565a disable gd formats by default #428
These are not normally used, so flip them off.  Hopefully no one notices.
Fixes #428.
2021-04-24 23:34:25 -04:00
willson-chen 8df65487ff drop support for VMS #453 2021-04-24 23:30:42 -04:00
Mike Frysinger b4eb70cf74 drop support for freetype <2.1.3
The configure script has already been requiring freetype-2.1.10+, so
this isn't really dropping old support.  Even then, 2.1.3 was released
in 2002, so users have had plenty of time to upgrade.
2021-04-24 23:27:45 -04:00
Mike Frysinger b2769ffe40 stop installing entities.h 2021-04-24 23:26:48 -04:00
Mike Frysinger d89be11633 open up 2.4.0 development for major(ish) changes 2021-04-24 23:21:42 -04:00
Mike Frysinger 4af36208b2 getver: fix shellcheck errors 2021-04-24 22:54:15 -04:00
Mike Frysinger 27da3a23e7 getver: rewrite from perl to shell+awk #535
People are more familiar with shell than perl at this point.
Fixes #535.
2021-04-24 22:48:24 -04:00
Khem Raj 93e53a7b80 replace uint32 with uint32_t and uint16 with uint16_6
uint16 and uint32 are now deprecated in libtiff and suggestion is to use
standard C99 types

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-04-23 02:13:46 -04:00
Mike Frysinger ef2b468a2d docs: strip trailing whitespace in generated files 2021-04-21 00:42:05 -04:00
Remi Collet 1e47a89a65 fix #655 relax test when libraqm is used 2021-03-18 09:59:05 +01:00
Ben Morss f6a111c632
Fix for libavif v0.8.2 (#680)
Don't return AVIF_RESULT_TRUNCATED_DATA, as this is normal for libavif <= 0.8.2. In our tests,
this makes tests pass with libavif 0.8.2.

Plus, we did a few things to stop compiler warnings - and added a newline to error output.

thanks @wantehchang for the collaboration here!

This fixes #677.
2021-03-16 12:26:17 -04:00
Christoph M. Becker 5b63349b82 Fix #679: ssize_t used in gdft.c won't compile under MS compiler
MSVC does not define `ssize_t` (nor `SSIZE_MAX`), so we add fallback
definitions to the generated config.h.

We also need to define `HAVE_CONFIG_H` which makes most of the other
defines there superfluous, but we leave them in since they don't hurt.
2021-03-16 12:22:00 -04:00
Ben Morss a29904a688
Set default AVIF encoding speed to 6 (#683)
Turns out that, in many cases, AVIF's default encoding speed (AVIF_SPEED_DEFAULT)
would be 0, the slowest possible speed.

The team's been working on making speed 6 a great compromise.
We should make this our default as well.
2021-03-16 12:19:06 -04:00
Martin Reboredo f7d12c91fa
Permit compilation with libheif version 1.7.0 (#686)
libheif versions that came before 1.9.0 don't support changing the output image chroma.
I did not notice that and it resulted with tests failures across other OSes that don't have
a much newer libheif.

See #678. Supersedes #685.
2021-03-16 11:53:16 -04:00
Remi Collet 048cb47f20 add missing image for heif test 2021-03-16 10:51:22 +01:00
Mike Frysinger 2e40f55bfb release 2.3.2 2021-03-06 14:16:01 -05:00
Mike Frysinger 6ca52e78bc avif: simplify tests with gdtest helpers 2021-03-06 13:55:40 -05:00
Mike Frysinger b04ff8dbc7 avif: add test images to dist 2021-03-06 13:55:06 -05:00
Martin Reboredo 3d142367bb
HEIF codecs check in test suite (#676)
Use the heif_have_decoder_for_format and heif_have_encoder_for_format
functions to find if HEVC decoding/encoding is supported by libheif.

Fixes #675.
2021-03-06 13:18:31 -05:00
Mike Frysinger 16fab2f35a cmake: allow tests to skip by exiting 77
The autotools framework supports this already.
2021-03-06 11:57:14 -05:00
Mike Frysinger 122799495c avif: fix build warnings in new code 2021-03-04 21:34:16 -05:00
Ben Morss f2aa2836ed
AVIF support (#671)
Demand for AVIF support on the web is growing, as the word gets out
about this new file format which allows higher-quality encoding at
smaller sizes.  Core contributors to major open-source CMSs are
interested in auto-generating AVIF images! They've been simply
waiting for support to appear in libgd.

This PR aims to meet the growing demand, and to help bring smaller,
more beautiful images to more of the web - to sites created by
experienced developers and CMS users alike.

This PR adds support by incorporating libavif in addition to the
existing libheif support.  It's generally felt that libavif has
more complete support for the AVIF format. libavif is also used
by the Chromium project and squoosh.app.

In this PR, I've endeavored to incorporate the latest research into
best practices for AVIF encoding - not just for default quantizer
values, but also an algorithm for determining the number of
horizontal tiles, vertical tiles, and threads.

Fixes #557.
2021-03-03 21:35:56 -05:00
Mike Frysinger e697147788 revert unneeded test change in previous commit
GH does not make it easy to edit PRs.
2021-03-03 02:19:32 -05:00
az6667 fc38677e80
Allow GIFs missing both Global and Local Colormaps to still decode (#494)
Ensure that a GIF without any Global or Local color tables is still
decoded by libgd.

GIF89a spec indicates conforming image files need not have
Global or Local color tables at all.

Spec recommends creating custom color map in that situation, and
that at least Black+White as first two entries, to ensure B&W images
are decoded.

Some commonly used single-pixel GIFs found around the web are
undecoded by libgd otherwise. Test case has been included.

References:
https://www.w3.org/Graphics/GIF/spec-gif89a.txt
http://probablyprogramming.com/2009/03/15/the-tiniest-gif-ever
2021-03-03 02:17:51 -05:00
Mike Frysinger a9a5b45983 drop redundant strcasecmp define
The common gd.h already provides this.
2021-03-03 02:08:46 -05:00
Martin Reboredo 39c4644fa0
HEIF support through libheif (#670)
With the adoption of AVIF by Firefox and Chromium based browsers (still
in experimental phase), the newer incorporation of HEIF by Canon and Sony 
in their cameras and the newer support of both of them in modern software 
like ImageMagick, GIMP and Krita, `gd` haven't seen any endorsement for
the formats up until this PR.

Reading and writing is done by `libheif`, with functionality for chroma 
subsampling (for now `4:2:0`, `4:2:2` and `4:4:4`), quality (with new
`200` for lossless) and compression (whether `HEVC` or `AV1`) selection. 

This was tested with `libheif` version `1.11.0` in my Solus machine.

Also, fixes both #395 and #557.
2021-03-02 12:32:03 -05:00
Ben Morss d6a061850d cmake: webp: remove implicit lib search relative to gd checkout
If the builder has packages in a diff location, they can specify them
globally.  The webp code shouldn't be searching for it specifically.
2021-02-26 12:48:15 -05:00
Mike Frysinger d6e3413f7f drop unused snprintf fallback
This was added ages ago with code that has since been deleted.
2021-02-21 12:48:22 -05:00
Mike Frysinger 3347842e7a bootstrap: tweak sed script to try and make it pass on macOS 2021-02-20 03:28:06 -05:00
Mike Frysinger 76db9d7c71 naturaldocs: fix program error from shell fixes
My previous changes to fix up shellcheck warnings broke this slightly
by not actually displaying the program name.  Add some debugging info
to help triage issues in here in the future.
2021-02-20 03:23:01 -05:00
Mike Frysinger 34048f3dac regen config.h.cmake to include new symbols 2021-02-20 03:08:39 -05:00
Mike Frysinger cf956ff56b bootstrap: fix config.h.cmake generation (#622)
The generated header file was manually changed, but rerunning this
script will change it back.  Fix the script to use the new format.
2021-02-20 03:07:57 -05:00
Mike Frysinger c0a55d9d00 add missing gd_intern.h include
I removed the local MIN/MAX macros, but missed adding the gd_intern.h
include when doing so.
2021-02-08 18:44:32 -05:00
Mike Frysinger c46a331f88 a few more shellcheck fixes 2021-02-08 18:18:27 -05:00
Mike Frysinger a056befe6e enable shellcheck github action 2021-02-08 18:11:49 -05:00
Mike Frysinger c75db8d082 scripts: clean up various shellcheck warnings
Should hopefully not break anything :).
2021-02-08 18:10:51 -05:00