Commit Graph

157 Commits

Author SHA1 Message Date
John Cupitt f8003bda67
Add tiffsave target (#2798)
* compiles, but untested

* works, but libtiff needs seek for write

next: add seek methods to target

* add target seek and read

seem to work

next: disc temps for disc output

* add libnsgif COPYING

oops, we were missing the COPYING file

see https://github.com/libvips/libvips/issues/2800

thanks mika-fischer

* tiffsave uses a disc temp if it can

* revise temp target rules

only make a disc temp if we are writing to a filesystem target

* add new target methods to targetcustom
2022-05-20 18:38:17 +01:00
Kleis Auke Wolthuizen 0337c09700
Cleanup gettext handling (#2695)
Use GLib's i18n support instead of copying and pasting that
logic into its own header. This deprecates the vips/intl.h
header in favour of glib/gi18n.h.
2022-02-27 15:27:28 +00:00
John Cupitt 561b670ea2 better dbg messages from tiffsave 2021-12-09 13:18:46 +00:00
John Cupitt 53ee983b51 oop, debug left enabled by mistake 2021-10-20 14:28:15 +01:00
John Cupitt 96604dba10 turning on subifd enable pyramid mode
see https://github.com/libvips/pyvips/issues/277
2021-10-20 10:40:03 +01:00
John Cupitt cf1228b927 fix page_height arg for tiffsave
it wasn't wired up, thanks @jacopoabramo

see https://github.com/libvips/pyvips/issues/277
2021-10-20 10:18:22 +01:00
John Cupitt 1192d87acf remove old libtiff numeric defines
use the glib ones instead rather than depending on stdint etc.
2021-10-01 17:29:43 +01:00
John Cupitt 5397fe5a4f note tiff change in changelog 2021-09-29 17:49:26 +01:00
John Cupitt be0b0d17b8 better tiff write looping
We were looping over pages, cropping each one out, and saving.

Now there's a single loop for thw whole of the image, so things like
percent reporting work in the obvious way.

See https://github.com/libvips/libvips/issues/2450
2021-09-29 17:45:58 +01:00
John Cupitt d4c5556c83 fix jp2k pyramid generation
8.11.1 broke it, unfortunately
2021-07-02 17:19:27 +01:00
John Cupitt 8851150375 fix some tabs 2021-06-28 20:32:56 +01:00
John Cupitt 4ee12e5675 trim some dead code 2021-06-28 20:31:09 +01:00
John Cupitt 95bf1367ba fix jpeg tiff pyramid save
we were not copying the quant tables on lower pyr levels correctly

add a test too
2021-06-28 20:24:00 +01:00
John Cupitt 03f76b73b4 add "premultiply" param to tiffsave
Some programs, like indesign, only work with premultiplied alpha in TIFF. To
make TIFFs which are compatible with these programs, we'll need an extra
TIFF save flag (perhaps premultiply?) to premultiply alpha and save as
EXTRASAMPLE_ASSOCALPHA.

see https://github.com/libvips/libvips/issues/2192
2021-05-01 20:08:06 +01:00
John Cupitt 7603c4b6ab fix some small bugs
- disable chroma subsample for jp2k-in-tiff ... it didn't work due to opj bugs
- revise numresolutions setting
- require opj 2.4 or later
2021-04-30 10:42:32 +01:00
John Cupitt edcdf8af70 rebase add-jp2ktiff on master 2021-04-26 15:16:20 +01:00
John Cupitt b14bac53a3 guard refs to ZSTD
so we work on older libtiffs
2021-03-05 12:16:38 +00:00
John Cupitt 495b54dfcf grou predictor settings 2021-03-04 17:31:08 +00:00
AdiosF6F 4d0252f31c
add tiff zstd predictor support 2021-03-04 22:38:47 +08:00
John Cupitt 86a6fd9d18 fix tiff deflate predictor setting
the enums were mixed up, thanks Adios

see https://github.com/libvips/libvips/issues/2128
2021-03-04 09:39:50 +00:00
John Cupitt 85f3ac6d8f fix tiff pyramid save region-shrink
we'd forgotton to connect it up

thanks imgifty

see https://github.com/libvips/libvips/issues/1875
2020-11-03 23:14:44 +00:00
John Cupitt fcaba0e6ba add @profile to webpsave
small tiffsave fixes too
2020-07-18 14:49:37 +01:00
Kleis Auke Wolthuizen 9246094033 Fix function pointer cast issues
It is undefined behavior in C and C++ to cast a function pointer
to another type and call it that way. This does work in most native
platforms, however, despite it being UB, but in WASM it can fail.

See:
https://emscripten.org/docs/porting/guidelines/function_pointer_issues.html
2020-06-30 13:35:41 +02:00
John Cupitt b2feb4805f fix flush of left-over bits
we were not adjusting for pixel size, thanks MathemanFlo

see https://github.com/libvips/libvips/pull/1672#issuecomment-644807739
2020-06-18 14:54:09 +01:00
John Cupitt 3b07f72b67 revise bit packing funcs in vips2tiff
smaller, simpler
2020-06-17 14:28:13 +01:00
John Cupitt 19077b53ac revise tiff2vips 1/2/4 bit load
simpler, faster, smaller
2020-06-17 13:59:02 +01:00
John Cupitt 8b469b4516 adjust formatting of 2, 4 bit tiff load/save
To make it libvipsey. Small fixes as well.
2020-06-16 18:58:27 +01:00
Florian Heinrich 0f0e8cb677 Fixed typo in bitdepth code 2020-06-16 16:27:11 +02:00
Florian Heinrich 00bd91a3c4 Fixed issues with bitdepth 2020-06-16 16:21:52 +02:00
Florian Heinrich 035e0bc756 Added read and write functionality for 2 and 4 bit greyscale TIF images 2020-06-09 11:23:28 +02:00
John Cupitt d5eecac88c add note about plane separate write 2020-06-05 12:14:40 +01:00
John Cupitt 460e1d0bf5 set n-subifds for tiff files
says how many subifds in the first page
2020-06-01 17:22:10 +01:00
John Cupitt d16f1e67dd fix tile clipping in toilet roll images
we were not clipping unaligned tiled correctly
2020-06-01 13:22:51 +01:00
John Cupitt 39af6c21c8 update notes 2020-06-01 00:55:19 +01:00
John Cupitt 0bdd2290a0 fix tiff directory mixup
we were not always selecting the correct read directory
2020-06-01 00:39:15 +01:00
John Cupitt aaebb3b346 fix thumbnail of mono image
we were using RGB as the shrink space
2020-05-27 15:24:27 +01:00
John Cupitt 474bfe3782 pytest and valgrind pass
remove some dbg code
2020-05-24 17:04:55 +01:00
John Cupitt a2d196b736 add subifd support to the TIFF writer
A new subifd switch enables the writing of pyramids layers into subifds
(rather than the default successive pages). This switch is enabled
automatically for multi-page pyramids.

seems to work in quick tests
2020-05-24 15:21:41 +01:00
John Cupitt 84b9d1f638 seems to make an OME pyramid correctly
```
$ vips tiffsave ../k2.jpg x.tif --tile --pyramid --subifd && tiffinfo x.tif
TIFF Directory at offset 0x900008 (9437192)
  Image Width: 1450 Image Length: 2048
  Tile Width: 128 Tile Length: 128
  Resolution: 72.009, 72.009 pixels/inch
  Bits/Sample: 8
  Sample Format: unsigned integer
  Compression Scheme: None
  Photometric Interpretation: RGB color
  Orientation: row 0 top, col 0 lhs
  Samples/Pixel: 3
  Planar Configuration: single image plane
  SubIFD Offsets: 11797898 12388230 12585130 12634526     0
```
2020-05-15 17:16:04 +01:00
John Cupitt 7deead8911 add a subifd flag to tiffsave 2020-05-13 12:45:28 +01:00
John Cupitt 03399b4d7e tiff write sets page number
tiffsave sets `PAGENUMBER` and `FILETYPE_PAGE`, thanks jclavoie-jive

see https://github.com/libvips/libvips/issues/1565
2020-03-08 11:06:19 +00:00
John Cupitt a158b15b97 add LOGLUV TIFF support
libvips XYZ images load and save as libtiff LOGLUV

see https://github.com/libvips/libvips/issues/1506
2020-01-29 17:47:08 +00:00
John Cupitt 42930e8d87 add "depth" param to tiffsave
Add a "depth" param to tiffsave to set pyramid depth, just like the
"depth" param on dzsave.

See https://github.com/libvips/libvips/issues/1485
2020-01-26 18:39:47 +00:00
John Cupitt 252996e3ff make check passes after stream -> source rename 2019-12-30 12:48:20 +00:00
John Cupitt 4c5873809f experiment with renaming stream
rename as VipsConnection, VipsSource, VipsTarget etc.

see https://github.com/libvips/libvips/issues/1494#issuecomment-569498619

renamed with this script:

```

set -e

edit() {
        sed -i -E "$1" rename
}

for i in $*; do
        cp $i rename

        edit s/VIPS_STREAMOU/VIPS_TARGET_CUSTOM/g
        edit s/VIPS_STREAMO/VIPS_TARGET/g
        edit s/VIPS_STREAMIU/VIPS_SOURCE_CUSTOM/g
        edit s/VIPS_STREAMI/VIPS_SOURCE/g
        edit s/VIPS_STREAM/VIPS_CONNECTION/g

        edit s/vips_streamou/vips_target_custom/g
        edit s/vips_streamo/vips_target/g
        edit s/vips_streamiu/vips_source_custom/g
        edit s/vips_streami/vips_source/g
        edit s/vips_stream/vips_connection/g

        edit s/VipsStreamou/VipsTargetCustom/g
        edit s/VipsStreamo/VipsTarget/g
        edit s/VipsStreamiu/VipsSourceCustom/g
        edit s/VipsStreami/VipsSource/g
        edit s/VipsStream/VipsConnection/g

        # eg. VIPS_TYPE_STREAM or VIPS_IS_STREAM
        edit "s/VIPS_([A-Z]+)_STREAMOU/VIPS_\1_TARGET_CUSTOM/g"
        edit "s/VIPS_([A-Z]+)_STREAMO/VIPS_\1_TARGET/g"
        edit "s/VIPS_([A-Z]+)_STREAMIU/VIPS_\1_SOURCE_CUSTOM/g"
        edit "s/VIPS_([A-Z]+)_STREAMI/VIPS_\1_SOURCE/g"
        edit "s/VIPS_([A-Z]+)_STREAM/VIPS_\1_CONNECTION/g"

        edit s/streamou/target_custom/g
        edit s/streamo/target/g
        edit s/streamiu/source_custom/g
        edit s/streami/source/g

        # various identifiers which also change
        edit s/is_a_stream/is_a_source/g
        edit s/find_load_stream/find_load_source/g
        edit s/find_save_stream/find_save_target/g
        edit s/new_from_stream/new_from_source/g
        edit s/write_to_stream/write_to_target/g
        edit s/vips_thumbnail_stream/vips_thumbnail_source/g

        # eg. vips_webpload_stream
        edit "s/vips_([a-z]+)load_stream/vips_\1load_source/g"

        # eg. vips_webpsave_stream
        edit "s/vips_([a-z]+)save_stream/vips_\1save_target/g"

        mv rename $i
done
```
2019-12-29 21:40:21 +00:00
John Cupitt e1baf66f19 "squash" to tiffsave now does lab as well
The "squash" option to tiffsave now also squashes 32-bit 3-band float
CIELAB images down to 8 bits.

See https://github.com/libvips/libvips/issues/1499
2019-12-18 17:29:34 +00:00
John Cupitt 112dc9101a remove early shutdown from tiff reader
since streams do this automatically now
2019-12-13 14:19:09 +00:00
John Cupitt 6fea2e7c57 clip negatives off LABS L in tiff save
Negative L in LABS needs to be trimmed off before savingf as TIFF.
Thanks angelmixu.

See https://github.com/libvips/libvips/issues/1499
2019-12-13 12:45:49 +00:00
John Cupitt 40bffa8cc6 small reformats
plus remove save multiband as separated multiink
2019-12-07 17:41:53 +00:00
Angel Sánchez c85454f56c Merge branch 'refs/heads/master' into improve-file-formats
# Conflicts:
#	libvips/conversion/switch.c
2019-12-04 11:49:18 +01:00