Commit Graph

5462 Commits

Author SHA1 Message Date
Leonard Hecker
80a0a24cfa Fixed deadlock in vips_cache_drop_all if vips__cache_dump is true
Both vips_cache_drop_all and vips_cache_print acquire vips_cache_lock
on entry, but vips_cache_drop_all calls vips_cache_print internally if
vips__cache_dump is true, leading to a deadlock situation.
This commit solves the issue using one further level of indirection
and a new vips_cache_print_nolock function.
2018-05-06 12:47:41 +02:00
John Cupitt
88b3644592
Merge pull request #959 from felixbuenemann/fix-png-filters
Fix wrong value for VIPS_FOREIGN_PNG_FILTER_ALL
2018-05-04 07:59:01 +01:00
Felix Bünemann
d3439f4d49 Fix wrong value for VIPS_FOREIGN_PNG_FILTER_ALL
The value is derived by oring all the filter flags:

    0x08 | 0x10 | 0x20 | 0x40 | 0x80 == 0xf8

The value was also checked against PNG_ALL_FILTERS in png.h.
2018-05-02 21:50:08 +02:00
John Cupitt
e496df598b working! 2018-05-01 15:50:48 +01:00
John Cupitt
9ac45f42e3 needs testing still 2018-04-30 17:38:32 +01:00
John Cupitt
b752d2e442
Merge branch 'master' into region-shrink-method 2018-04-27 15:58:24 +01:00
John Cupitt
dd07d6ab7d note g_free() for write_to_memory result
see https://github.com/jcupitt/libvips/issues/929
2018-04-27 11:34:56 +01:00
John Cupitt
4d683559aa add a fontfile option to text
use @fontfile to give a font to load ... note that this just loads the
font, you'll need to set it with @font as well

see https://github.com/jcupitt/libvips/issues/950
2018-04-26 21:03:40 +01:00
John Cupitt
6ee7789095 tiny docs update 2018-04-26 16:28:09 +01:00
John Cupitt
6952c57ca0 better temp filename handling
- make access() fail only if we are certain the file does not exist
- remove the g_mkstemp() from vips__temp_name()

should help selinux

see https://github.com/jcupitt/libvips/pull/930
2018-04-26 16:14:12 +01:00
John Cupitt
9714dcdee3 test depth as well in magickload
We were testing width / height / bands when verifying that it was OK to
load a toilet-roll image ... of course we should test depth as well.
2018-04-26 13:57:33 +01:00
John Cupitt
3a9d322574 magick7 tests for all frames equal before load
it used to crash if pages changed in size
2018-04-26 13:45:50 +01:00
John Cupitt
05fd7d9301 oop typo 2018-04-26 11:49:47 +01:00
John Cupitt
da6f4fd043 add n-pages metadata item
tiff, magick and pdf load now attach an n-pages metadata item recording
the number of pages in the orginal file

see https://github.com/jcupitt/libvips/issues/953
2018-04-26 08:55:31 +01:00
John Cupitt
4f22e8d1dc add jpeg-chroma-subsample to jpegload
The jpeg loader now sets the field jpeg-chroma-subsample to record
chroma subsample.

See https://github.com/jcupitt/libvips/issues/954
2018-04-25 16:04:20 +01:00
John Cupitt
38ea5937ca more help for graphicsmagick
but still not quite there
2018-04-24 17:14:51 +01:00
John Cupitt
c410dc2db8 add format option to magickload
Some magick coders (eg. ICO) don't sniff the filetype from the data, so
when you try to load from a string, imagemagick is unable to pick the
right decode path.

Add a @format option so callers can hint the filetype.

see https://github.com/jcupitt/pyvips/issues/39
2018-04-24 15:06:52 +01:00
John Cupitt
a40382fe50 Merge branch '8.6' 2018-04-23 15:18:17 +01:00
John Cupitt
18c50c3231 typo in configure.ac 2018-04-23 15:17:53 +01:00
John Cupitt
12cbe7c2e4 some work on fixing GM
graphicsmagick + magicksave is a bit tricky :(
2018-04-23 13:44:56 +01:00
John Cupitt
b8ff9c2069 remove progressive pdfload advice
does not apply to pdfium, and hardly to poppler
2018-04-13 10:15:41 +01:00
John Cupitt
1dbd03eefe update for new pdfium package 2018-04-12 13:10:30 +01:00
John Cupitt
fbcdb58f7b remove precise from travis 2018-04-11 19:36:18 +01:00
John Cupitt
c0569d25bf final fixups
- add buffer load
- test under valgrind
- code sharing with the poppler pdf loader
2018-04-11 18:53:38 +01:00
John Cupitt
3d696b9c1e Merge branch 'master' into pdfium-experiment 2018-04-11 18:00:33 +01:00
John Cupitt
5b55dd8ed4 Merge branch '8.6' 2018-04-11 09:38:59 +01:00
John Cupitt
24b146790f oop reorder crop to come after cache
or we'll write beyond the buffer end
2018-04-10 15:39:51 +01:00
John Cupitt
d1dd41a21f strict round down on jpeg shrink
libjpeg rounds up on shrink-on-load. In some cases this can leave a dark
line along the right and bottom edge, since it only contains (for
example) 1/4 of a pixel of data.

This change adds a crop after jpeg load so that only complete pixels are
output.

See https://github.com/lovell/sharp/issues/1185
2018-04-10 15:18:18 +01:00
John Cupitt
f1f2a9de55 fix a warning if tiff is disabled 2018-04-10 15:14:09 +01:00
John Cupitt
15abbbe986 set "interlaced" for jpg and png
set "interlaced" for interlaced png and jpg images
2018-04-09 17:14:38 +01:00
John Cupitt
06802e4110 use O_TMPFILE, if available
If O_TNMPFILE is available, use it. This is a linux extension that
creates an unlinked file, so it'll be closed by the system when the last
associated fd is closed.

see https://github.com/jcupitt/libvips/pull/930
2018-04-09 13:27:57 +01:00
Karthik Karanth
8d04dab0db remove unnecessary args in composite2 2018-04-09 13:14:03 +05:30
Karthik Karanth
d06f420763 use vips_embed to position images 2018-04-09 12:57:21 +05:30
John Cupitt
2a82744a10 working at a basic level
TODO

- more code sharing with pdfload.c, eg.  vips_foreign_load_pdf_is_a_buffer()
  and get_flags etc.
- could share the page layout code too
- make pdf.c with base stuff in?
- what about filename encodings
- test transparency
- new_from_buffer needs doing
2018-04-08 18:04:06 +01:00
John Cupitt
f3842dcc4b update cpp example
thanks fangqiao

see https://github.com/jcupitt/libvips/issues/932
2018-04-08 11:44:15 +01:00
John Cupitt
05456125b6 builds, links and mostly runs 2018-04-07 17:36:52 +01:00
Karthik Karanth
e406015fe8 add args 2018-04-07 13:57:27 +05:30
John Cupitt
56fe608cfb start adding pdfium load 2018-04-06 09:29:45 +01:00
John Cupitt
83d4ee0b0b update find_pdfium for latest packaging
hey ho ouch
2018-04-05 12:10:43 +01:00
John Cupitt
67916e8ead Merge branch 'master' into pdfium-experiment 2018-04-05 11:17:48 +01:00
John Cupitt
1e647a2af4 Merge branch '8.6' 2018-04-04 17:46:36 +01:00
John Cupitt
915226db21 oop missing a seek 2018-04-04 17:46:14 +01:00
John Cupitt
5f3bcd88ae Merge branch '8.6' 2018-04-04 17:11:16 +01:00
John Cupitt
632bce3c78 reduce stack use for radsave
fixes a crash on very low stack libcs like musl
2018-04-04 16:25:35 +01:00
John Cupitt
aebb8af803 create funcs always make MULTIBAND
Before, they could make B_W for one-band output. This caused problems
with (for example) two black image bandjoined: the second band then
looked like an alpha to hasalpha() and enabled premultiply/unpremultiply
for operations like affine.

Now, it's always MULTIBAND. This is the generic multiband image type, so
you don't get any unexpected alpha handling.
2018-04-04 09:22:57 +01:00
John Cupitt
0dd6b095aa more conservative hasalpha
The result of hasalpha is used to turn on things like
premultiplication, so we should be rather conservative
about when we signal this. We don't want to premultiply
things that should not be premultiplied.

Check Type as well as bands.

See: https://github.com/jcupitt/libvips/issues/918
2018-04-03 14:36:43 +01:00
John Cupitt
e686614f2c drop incompatible profiles from save
libpng has started throwing hard errors if the profile does not match
the image -- this can happen all the time with perofiles inherited from
images that have been processed.

Test profiles before save and drop them (with a warning) if they are
incompatible with the image.
2018-04-01 10:32:48 +01:00
John Cupitt
38f459711b detects pdfium correctly
and builds without anything else breaking
2018-03-30 22:17:43 +01:00
John Cupitt
9c2ae52820 start adding pdfium tests
though they fail with link problems
2018-03-30 11:59:57 +01:00
John Cupitt
85615a7fbd gtk-doc annotation update 2018-03-29 09:18:36 +01:00