summaryrefslogtreecommitdiff
path: root/devices/gdevtifs.c
Commit message (Collapse)AuthorAgeFilesLines
* Update postal address in file headersChris Liddell2023-04-041-2/+2
|
* Bug 706388: Fix a typo writing the gs version to TIFF tagsChris Liddell2023-02-271-2/+2
| | | | Thanks to Michael Osipov for pointing this out
* OSS-fuzz #49266 - avoid a divide-by-zero errorKen Sharp2022-07-191-2/+7
| | | | | | | | | | The TIFF devices Set the RowsPerStrip tag by dividing the max_strip_size by the width of the raster. However it is entirely possible to set the media size to a width of 0 pixels (when resolution is taken into account), which causes a divide by zero. Just check the width before dividing and if it is not at least 1 then return an error.
* Update -DCLUSTER nobbling of copyright/version etc.Robin Watts2022-06-011-0/+2
| | | | | | | | | | | | | | | | | | When regression testing different versions, we'd like the files to be byte for byte comparable. This is broken by output files that contain comment fields or tags that list the creator versions. The cluster nobbles at least some of these by hackily rewriting the gscdefs.h file at build time, but misses files that differ because of the copyright message. Also, this hackery is hard to reproduce when building our own versions to try and recreate problems seen in the cluster. Accordingly, add some #definery within base/gscdefs.h that performs the same function dependent only on -DCLUSTER. Also tweak some devices to ensure that they don't use revision numbers/copyrights etc.
* Update libtiff to 4.3.0Chris Liddell2022-05-111-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Changes to libtiff for gpdl. 1) Ensure that libtiff doesn't mess with 'boolean' in GS builds on Windows. Without this, the jpeg structures used by our JPEG lib build are different in size when called from gs and libtiff, resulting in runtime errors. 2) Update libtiff so that it can correctly call into the jpeg library so that memory operations happen from our pools, not malloc/free. Slightly horrid in that this is more complex with OJPEG than JPEG files. Fix some compiler warnings stemming from libtiff update Various tweaks for libtiff 4.3.0 to build on Windows Mainly "importing" tif_config.vc.h and tiffconf.vc.h - the tiff build now created those with cmake. Then typedef'ing several C99 ***_t style types. Finally defining matching C99 PRI* printf formatting macros
* Update plan devices to use the downscaler, plus various fixes.Robin Watts2022-03-071-40/+6
| | | | | | | | | | | | | | | | | | | | | | | | Specifically this is intended to allow use of -sPostRenderProfile so we can (for example) use the plan device to render in RGB, then convert to cmyk as a post-process step. In preparing this commit, various problems were found in the planar downscaler, and these are fixed here too. In addition, to avoid every device that wants to support PostRenderProfile needing an identical batch of code to create the icclink, we extract that into a gx_downscaler_create_post_render_link helper function, and use that in the appropriate devices. As a knock on for that, we tweak gsicc_free_link. Firstly, it no longer takes a memory pointer, but rather uses the one in the link itself. This is a step up from the existing code that appears to allocate with 'stable_memory' and then free with 'non_gc_memory'. I suspect we've been getting away with this by chance because the two have always happened to be the same. Secondly, it performs the 'free_link' operation as part of the call. This enables all the call sites to be simplified.
* Overprint simulation and OutputIntent interactionMichael Vrhel2022-03-021-2/+0
| | | | | | | | | | | | | | | | | In cases where -dOverprint=/simulate and -dUsePDFX3Profile are used, if the page has overprint and no transparency push the pdf14 device and render the page to a transparency buffer to the Output intent color space. If the target device has a different ICC profile than the output intent (specified with something like -sOutputICCProfile="Fogra39.icc") then convert the output intent rendered buffer to the target device color space. Also make sure that the tiff device do not use the wrong profile in the header. Additionally, a problem was found where the pdf14 device was setting up color conversions using the perceptual rendering intent. Those transforms should be using the colorimetric rendering intent.
* Move devices from gs_sprintf to gs_snprintf.Robin Watts2022-02-161-3/+3
|
* Support -dDeskew for planar devices.Robin Watts2021-05-241-2/+0
| | | | | | | | Automatic skew detection/correction for planar devices that use the downscaler (such as psdcmyk). Change -dDeskew to be boolean. Remove stray trap setting for tiffscaled32.
* Update copyright to 2021Chris Liddell2021-03-151-1/+1
|
* Add patch version to version numberChris Liddell2020-08-181-2/+6
| | | | This makes it easier to issue patch releases for security problems.
* Rework downscaler initialisation.Robin Watts2020-06-031-21/+17
| | | | | | | | Pass the downscaler parameters into the downscaler init routines, rather than explicit values. This reduces the size of the API, and means that future additions to the structure will automatically be passed through.
* Fix memory leaks in tiffsep.Robin Watts2020-06-011-1/+1
| | | | | | | | | | Calling TIFFCleanup doesn't close the underlying tiffio. Call TIFFClose instead. Now the tiff io close handler is actually called, be careful not to close the underlying file twice. Finally, actually remember to close the comp file.
* Remove "magic numbers" from profile type selectionMichael Vrhel2020-05-111-3/+3
|
* Update copyright to 2020Chris Liddell2020-04-101-1/+1
|
* Fix devices that ignore return codes from gdev_prn get_bits & copy_scan_linesRay Johnston2019-11-131-1/+4
| | | | | | | | | | | | | | | | Discovered these when working on bug 701845 'devicen' device. Checking uncovered a plethora of other places that used one of these functions assuming success. Also the gdev_prn_copy_scan_lines had places that assumed the return code was a valid line_count, so if negative, could memset many lines in front of an allocated buffer. The code in a few of these usages is strange, and we don't have a way to check them, so this may not match the original intent. Also, while perusing all of these files, check devices for alloc's that assume success and fix them (usually return gs_error_VMerror).
* Nobble various uses of "time" in the code in CLUSTER builds.Robin Watts2019-10-311-0/+5
| | | | | This causes the bjccolor device at least to give indeterminate results. Nobbling the rest won't hurt.
* Move FILE * operations behind new gp_file * API.Robin Watts2019-05-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (squash of commits from filesec branch) Most of this commit is donkeywork conversions of calls from FILE * -> gp_file *, fwrite -> gp_fwrite etc. Pretty much every device is touched, along with the clist and parsing code. The more interesting changes are within gp.h (where the actual new API is defined), gpmisc.c (where the basic implementations live), and the platform specific levels (gp_mswin.c, gp_unifs.c etc where the platform specific implementations have been tweaked/renamed). File opening path validation All file opening routines now call a central routine for path validation. This then consults new entries in gs_lib_ctx to see if validation is enabled or not. If so, it validates the paths by seeing if they match. Simple C level functions for adding/removing/clearing paths, exposed through the gsapi level. Add 2 postscript operators for path control. <name> <string> .addcontrolpath - Add the given <string> (path) to the list of paths for controlset <name>, where <name> can be: /PermitFileReading /PermitFileWriting /PermitFileControl (Anything else -> rangecheck) - .activatepathcontrol - Enable path control. At this point PS cannot make any more changes, and all file access is checked.
* Update source/header file copyright notice to 2019Chris Liddell2019-01-161-1/+1
|
* Update copyright notice with new head office address.Ken Sharp2018-01-301-3/+3
| | | | | | | | | Also update copyright dates. Remove gs_cmdl.ps as we no longer use it, and remove its entry from psfiles.htm. Remove xfonts.htm as this feature (xfont support) is long, long gone.
* Device method repair - use accessors throughoutKen Sharp2017-11-161-2/+2
| | | | | A lot of places accessed device methods directly, instead of using the accessor macros. Update all the code to use the accessors.
* Add ETS to Downscaler.Robin Watts2016-12-121-11/+27
| | | | | | | | | Currently only hooked up for tiffscaled and tiffscaled4. Enable using -dDownScaleETS=1 along with the usual other downscaler hooks. No control over all the myriad ETS flags as yet.
* Add support for -sPostRenderProfile="icc profile" to tiffscaled devicesMichael Vrhel2016-07-221-13/+94
| | | | | | | | | | | | | With this commit, it is possible to have the tiffscaled32, tiffscaled24 and tiffscaled8 devices apply an ICC profile after rendering, which will transform the rendered page to the color space defined by PostRenderProfile. When used in conjunction with -dUsePDFX3Profile, if the source file contains an Output Intent profile, the page will be rendered first to the color space defined by the output intent profile and then transformed to the color space defined by the PostRenderProfile setting. In this way, we can avoid issues caused by mismatching ICC profiles in overprint situations. This along with the commit http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=0df325b4bdbd037c92e2528fc16900de84f8d9c1 are needed to create a patch.
* Coverity ID 126581 - cast to avoid implicit sign extensionKen Sharp2016-06-061-1/+1
|
* Bug 696620: Avoid rangecheck errors in tiff devices.Robin Watts2016-03-011-3/+5
| | | | Only write downscaler options if we will read them.
* Update devices to return errors using return_error.Robin Watts2016-02-181-3/+3
|
* Bug 696571: Fix rangecheck in tiffscaled.Robin Watts2016-02-091-2/+3
| | | | I was putting some params that I wasn't getting (or vice versa).
* Reduce boilerplate downscaler params handling.Robin Watts2016-02-051-134/+23
| | | | | | | | | The same sets of parameters (or subsets thereof) are read/ written in many devices get/put_params routines to control the downscaler. Arrange to read/write these all in one place to keep the code simpler.
* Initial import of ClapTrap.Robin Watts2016-02-051-3/+107
| | | | | | | | | | | | | | | | | | | | | | | Hooked in under the downscaler, so accessible to any device that calls the downscaler without too many changes. Only enabled for CMYK devices, so tiffscaled32, tiffsep and psdcmyk. -dTrapX and -dTrapY set the horizontal and vertical search areas. Use 0 for off, otherwise n searches +/- n either side. TrapOrder sets the cmyk spot ordering from darkest to lightest. For CMYK, default is [ 3 1 0 2 ] (K, M, C, Y). For CMYK and spots, default is [ 3 1 0 2 4 5 6 7 ... ]. This will be wrong if spots aren't arranged in darkest to lightest order. A typical command line might look like: gs -sDEVICE=tiffsep -dTrapX=2 -dTrapY=2 -o out.tif -c "<< /TrapOrder [ 3 1 0 2 ] setpagedevice >>" -f examples/tiger.eps
* Squash warnings: MSVC ones.Robin Watts2016-01-041-2/+2
| | | | | | | | | | | Tweak the code to avoid the warnings seen in the MSVC debug build of gs. Mostly adding a few casts to make type changes explicit (and hence avoid the "casting from int to double might lose data" etc warnings). Reorder the headers in a couple of places to avoid offsetof being redefined in a system header warnings.
* Make writing TIFF DateTime tag optional.Chris Liddell2015-12-041-3/+18
| | | | | | | Add a -dTIFFDateTime option, defaults to "true" (existing behaviour) and -dTIFFDateTime=false prevents the tag being written to the output file. Also, document this and the UseBigTIFF option.
* Commit of build_consolidation branchChris Liddell2015-07-201-0/+541
Squashed into one commit (see branch for details of the evolution of the branch). This brings gpcl6 and gxps into the Ghostscript build system, and a shared set of graphics library object files for all the interpreters. Also, brings the same configuration options to the pcl and xps products as we have for Ghostscript.