| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
"planar" can either be PLANAR_CONTIG or PLANAR_SEPARATE. We've
checked for PLANAR_CONTIG earlier, so no point in checking we're
not PLANAR_SEPARATE later.
|
|
|
|
|
|
|
|
|
|
|
| |
This supports the common form of Multipage TIFFs, whereby a single
TIFF has multiple IFDs.
We do not yet support the (much rarer) form of multipage TIFFs
whereby we have a single IFD with sub-ifd's in it.
Those are supposedly used for strange things like multiple subsamplings
of the same image, so are probably not actually what we want anyway.
|
|
|
|
|
|
| |
Hopefully no change in behaviour.
This opens the way for multi-image support.
|
|
|
|
| |
Improve error messages.
|
| |
|
|
|
|
| |
Seen with the second tiff from bug 706539.
|
|
|
|
|
|
|
|
| |
After decoding the first tiff, we free the buffer used to
hold the tiff, but forgot to reset the size of the buffer.
This meant that on trying to read the second tiff, we'd
attempt to use an empty buffer, and crash.
|
|
|
|
| |
This stops the crash seen in Bug 706534.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
A C parameter list leaks when used in gpdl. Presumably this is
not seen in gs operation because of garbage collection.
We already have a function to allocate a C parameter list
(gs_c_param_list_alloc). We've always been releasing this
(gs_c_param_list_release), but that just releases the contents
not the list itself. Add a new function (gs_c_param_list_free)
that both releases and frees, and call this as appropriate.
|
|
|
|
|
|
|
| |
For PLANARCONFIG_SEPARATE things, we need to get the 3 components
one after another. We were overrunning the end of the buffer.
gs -sDEVICE=png16m -o out.png ../tests_private/tiff/oxford.tif
|
|
|
|
| |
Use the stream init functions.
|
|
|
|
|
|
|
| |
The previous fix to avoid integer overflow was monumentally
broken.
Less monumentally broken code here.
|
| |
|
| |
|
|
|
|
| |
Give an error, rather than setting ourselves up to fail later.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Spots ascii/utf8/utf16 and feeds to PCL interpreter.
May need further tweaking with both text file spotting and
font selection, but it's a decent start.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the postscript interpreter is run by itself, it has to
cope with decoding arguments supplied on the command line
into our internal format of utf8. For windows, this means
that it has to cope with converting from 'local' encoding to
utf8.
When we run gs under gpdl this decoding is done under the
pl level, so it's important that gs does not do such decoding
otherwise it will 'double decode'. Accordingly, disable the
decoding in the psitop.c layer.
|
|
|
|
| |
Link with an external SO lib, rather than calling out to an exe.
|
|
|
|
|
| |
No actual SmartOffice code here, just the framework for adding
the (private) "SO" interpreter.
|
|
|
|
|
|
|
|
|
|
|
| |
We need to initialise Ghostscript with the nullpage device when calling it via
gpdl (so we can later replace the nulldevice with the "real" output device).
Using the "shortcut" of "-dNODISPLAY" to install the nulldevice as the initial
device ends up disabling the interactive prompt between pages.
This just changes things specify "-sDEVICE=nullpage" explicitly, avoiding that
problem.
|
|
|
|
|
| |
Spotted by valgrinding the file/command line from bug 704692. Sadly,
this doesn't fix the actual problem though.
|
|
|
|
|
| |
Means extending the pdf_detect_language() to check the first five (rather than
two) bytes in the input.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
plmain.c should not be setting the PageSpotColors
value. This should be set by the individual
interpreters on a per page basis. This change
fixes a crash (Bug 704660) reduces the number of
closing and opening times of the device with pdfi
and pdfi renders more than 4 spots to the separation
devices just fine. Also for gpdl with HEAD, the subsequent
execution of a PS file following a PCL file
did not properly reset the PageSpotColors to -1
as is required for PS files, resulting in improper
output when going to a separation device. This commit
includes a fix for that. Tested with command line
gpdl -sDEVICE=psdcmyk -r72 -o ./myoutputs/pdl_input_%d.psd
./myinputs/owl.pcl ./myinputs/Ad_InDesign.ps
./myinputs/spots_multi_page.pdf ./myinputs/input.xps
./myinputs/deviceNImage.eps ./myinputs/DeviceN_20Colors.pdf
./myinputs/page_spots/Ad_InDesign.ps
to verify that the number of spots was getting properly
set with each interpreter and page (when applicable) change.
|
|
|
|
|
|
|
|
|
| |
The manufacturer, version and build date entries in the
pl_interp_characteristics_t were never really used except for version, which
was just set to the GS_VERSION.
Remove the pointless entries, and use a more direct approach to version
reporting.
|
|
|
|
|
|
|
|
|
|
|
| |
This is a commit of the pdfi branch to master, eliminating
the traditional merge step.
The full history of the pdfi branch can be seen in the repo,
and that branch is effectively frozen from this point onwards.
This commit actually differs from pdfi in a small number of
whitespace changes (trailing spaces etc).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this instance 'RESOURCES' means fonts, macros, symbol sets etc.
This applies to PCL (and maybe others), but not Postscript
resources.
Default (and setting this to 0) gives the behaviour where resources
are never reset based upon job language changes.
Setting this to 1 causes resources to be reset between jobs (whenever
we return to PJL).
Setting this to 2 causes resources to be reset whenever we "change
language". For this setting, we do not count returning to PJL and
reentering the same language as being a language change.
(Includes fixes and code from Henry Stiles).
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Jpeg code uses setjmp/longjmp for error handling. On Windows at
least, in 64bit builds, jmpbufs need to be 16 byte aligned. This is
generally achieved by malloc blocks being 16 byte aligned, and
structures have their offsets calculated so that their contents lie
at appropriate positions.
Unfortunately, our malloc routines only align to 8 byte aligned.
We therefore bend the jpgtop.c code to align the jmpbuf manually.
Similar tricks are required in the pngtop.c code, which also uses
setjmp/longjmp, but a slightly different approach has to be taken
as the png routine allocates the structure with the callback in
itself, so we don't get to align just that. Instead, we modify the
allocation routines that we provide to pnglib so that blocks are
correctly padded.
|
|
|
|
|
|
| |
The PHOTOMETRIC_SEPARATED case would only handle num_comps == 3, but the
tiff32c device creates 4 component images with PHOTOMETRIC_SEPARATED.
Allowing 3 or 4 components works.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move the compiler parameters around so the third party lib specific -I options
come first - hopefully meaning we'll favor any included headers over those in
the system include path(s).
This assumes the compiler searched include directives given on the command line
left to right. Apparently this used to be a problem, I've not found a recent
compiler that breaks that assumption (yet!).
This applies to: expat, freetype, ijs, jbig2dec, jpeg, jpegxr, openjpeg, png
tiff and zlib
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allow for a 'parsed' param type; this leverages the functions in
gsparaml.c to parse an input string into a param list, coping
with dictionaries and arrays.
We update those functions to improve behaviour on more exotically
formed numbers ("- 0.3e-10" etc), on 'tricksy' inputs (e.g.
"<< /Foo (>>) >>" etc) and to cope without relying on whitespace
(e.g. "<</Foo/Bar/Baz[1 0]/Fizz<1234>/Bang(A)>>" etc).
Update pl_implementation set_param entrypoint so that the language
interface itself is based upon param lists, rather than typed
params.
Update both implementations of gsapi_set_params so that if
we are too early in the setup process stuff goes into the list
and is held until we have devices/languages to pass it to. Also
add a flag to allow for 'more to come' so that we can effectively
set multiple params at once.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
More generally, we can now cope with any language implementation
requesting that data being fed in via run_string should be
buffered up and then fed in via run_file instead, so formats that
require seeking can cope.
We add a new gs_error_NeedFile error code. If a run_string
implementation returns this, the calling gpdl layers captures
the unused incoming data into an internal "buffered_file" object.
When we reach run_string_end, we then register a new filing
system with gs_add_fs() to allow this buffered file to be found.
We then run that file using the standard run_file mechanism.
Then we remove that filing system, and free the buffered file.
The only implementation that currently uses this is the
postscript one, which is amended to skip over leading whitespace
and comments, looking for a PDF header.
XPS already has a mechanism in it for collating data
into a file using run_string, but this was broken (due to
process_eof not being called). Fixed here, but still using its
own mechanism rather than gs_error_NeedFile for now.
|
| |
|
|
|
|
| |
Never used.
|
| |
|
| |
|
|
|
|
|
| |
When building with shared libs, we should not try to include our custom libjpeg
memory management context into the TIFF reader implementation context.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
According to the JBIG2 specification segments numbers are 32 bit unsigned
integer. Previously any segment numbers larger than INT32_MAX would be passed
as negative numbers.
Some parts of the decoder do not yet know, or do not have access to the
currently decoded segment number, and this needs to be specially indicated.
Therefore jbig2dec appropriates the unlikely segment number 0xffffffff to
indicate an unknown segment number.
This is a change of the public API.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When memory squeezing gpdl, Julian found leaks in the gpdl
startup of the postscript interpreter when allocations failed
in gs_main_init_with_args01().
Here, we fix the problem by making the psitop.c layer within gpdl
call the appropriate shutdown code when we catch the error. This
moves gpdl to being consistent with other users of the gs_main
layer.
Memento memory squeezing around the point of failure (event 2035)
now shows this to be OK.
MEMENTO_SQUEEZEAT=2034 ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
|
|
|
|
|
|
|
| |
by memento).
Fixes:
MEMENTO_FAILAT=2017 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
|
|
|
|
|
|
|
| |
The JP2K spec says we should spot "jP ", where previously
we'd only been spotting "jP\1a\1a". No idea where that
latter one came from, but presumably we've been seeing it
in some files. Make the code cope with both.
|
|
|
|
|
| |
YCbCr TIFFs have to use TIFFRGBAImage as for the old JPEG
encapsulation.
|
|
|
|
|
|
|
|
|
|
| |
Support JPEG encoded TIFFs (both old and new formats).
Old JPEG format requires the whole image to be decoded to an
RGBAImage in memory at once; looks like that's just a limitation
of libtiff. This is particularly annoying because it looks like
the internals of libtiff are prepared to do scanline extraction
as you'd hope, but aren't exposed to the outside world.
|
|
|
|
|
| |
Support tiled TIFFs, planar TIFFs, and TIFFs where the resolution
isn't properly specified.
|