Commit Graph

2057 Commits (b4eb70cf741ad27d3588ad3d9aad339ac4ddb8ed)

Author SHA1 Message Date
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
Mike Frysinger e1f02d2833 gd_intern: unify the min/max/clamp macros some more 2021-02-05 22:47:13 -05:00
Mike Frysinger f538eedc7c gd_filename: constify & localize more
Mark the data structures & functions as const & static when possible,
and punt the unused FType enum.
2021-02-05 00:45:55 -05:00
Mike Frysinger 4690d1ceb6 gitignore: update Windows tools 2021-02-02 21:59:15 -05:00
WilliamHeaven 4dd5f43bc6 Fix copyright format problem 2021-02-01 22:39:33 -05:00
wilson chen 75ef79c9b0
release-2.3.1 (#668) 2021-01-30 15:16:05 +08:00
Mike Frysinger fb33294724 webp: support pkg-config file 2021-01-20 15:17:14 -05:00
Mike Frysinger 82b08997c1 gd_io: replace internal Putchar with gdPutC
Most code is already using gdPutC instead of Putchar -- only the bmp
module is using Putchar.  It's unclear why we have this other form as
they should be equivalent: gdPutC takes an unsigned char (8-bits) and
then calls ctx->putC while Putchar takes a signed int, masks it with
0xff, and then calls ctx->putC.

The history of these funcs goes back to when it's initially imported
as part of the 1.5.0 release, and there doesn't seem to be any notes
as to why.

So change bmp to use gdPutC so we can delete Putchar entirely.  The
function isn't exported so no one should even notice.  Our tests are
still passing, so hopefully that provide good coverage.
2021-01-11 19:15:17 -05:00
Mike Frysinger 8d63967a52 gd_io: trim unused Putword function 2021-01-11 18:53:50 -05:00
Christoph M. Becker 9ed642764c Fix potential integer overflow detected by oss-fuzz 2020-08-24 17:03:07 +02:00
Remi Collet 0be6aec0fe Fix #615 using libraqm
and avoid unneeded free
2020-07-15 09:45:07 +02:00
wilson chen 28ecfe77c8
fix #303: gdlib.pc: use Requires instead of Libs (#537) 2020-06-18 14:55:32 +08:00
wilson chen 93f42630f4
.travis.yml: close config warning and info (#642)
* sudo is deprecated and has no effect anymore
* add dist to specify xenial explicitl
2020-05-28 14:58:44 +08:00
willson-chen 7a73f68401 travis/main.sh: fix indent error 2020-05-22 23:17:23 +08:00
wilson chen bc658270f5
tests/gdimageline/gdimageline_bug5: add im null judgement (#624)
gdImageCreate returns NULL in gdimageline_bug5.c on AIX, which make the judgement necessary in case of segment fault.
2020-05-20 19:29:23 +08:00
wilson chen 43df499f1f
Update travis/main.sh (#640)
* Use 'if [[ ]]' instead of 'if [ ]'
* Append args to cmake_args by '+='
2020-05-20 00:09:53 +08:00
Marek Skalický 4abc26cca6
Compute average in gdGuessBackgroundColorFromCorners properly (#483) 2020-05-13 19:19:08 +08:00