Bug 690246 - DOINTERPOLATE doesn't work with rotation
Summary: DOINTERPOLATE doesn't work with rotation
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Graphics Library (show other bugs)
Version: 8.63
Hardware: Macintosh MacOS X
: P2 enhancement
Assignee: Henry Stiles
URL:
Keywords:
: 689521 691719 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-01-21 14:10 UTC by Marcos H. Woehrmann
Modified: 2012-10-30 19:46 UTC (History)
5 users (show)

See Also:
Customer: 190
Word Size: ---


Attachments
SmallRasterImage.pdf (248.31 KB, application/pdf)
2009-01-21 14:11 UTC, Marcos H. Woehrmann
Details
0001.patch (54.81 KB, patch)
2011-05-27 22:55 UTC, Robin Watts
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marcos H. Woehrmann 2009-01-21 14:10:31 UTC
The customer reports:

We have a problem with the interpolation. When we Rip with a rotation, the flag -DDOINTERPOLATE has 
no effect.

I don't know how I can reproduce with the standard GS, because I've never understood clearly how you 
could rotate a file (e.g -dAutoRotatePages almost never works). In our custom devices, we force a 
rotation by modifying the matrix in get_initial_matrix().

I understand GS can desactivate the interpolation on certain images in case it is not needed (e.g. when 
the scale for this image, when going from input to output pixels, is near 100%), which is a good thing. 
Apparently this work in the normal case, but not with a rotation.

I attach a sample file, with which you'll maybe reproduce the problem. It contains a very small raster 
image (12x13).
Comment 1 Marcos H. Woehrmann 2009-01-21 14:11:00 UTC
Created attachment 4746 [details]
SmallRasterImage.pdf
Comment 2 Alex Cherepanov 2009-01-21 14:33:08 UTC
*** Bug 689521 has been marked as a duplicate of this bug. ***
Comment 3 Henry Stiles 2009-06-23 09:08:39 UTC
Consultation with the customer about the best way to use gs to solve their
problem is needed, if changes in interpolation are needed please assign to Michael.
Comment 4 Alex Cherepanov 2009-11-10 15:44:12 UTC
Interpolation of rotated images can be quickly hacked by filtering the source
stream before feeding it to the image operator. In fact, this is how it
is already done for black-and-white 1 bit/pixel images.

Comment 5 Michael Vrhel 2011-05-03 16:13:01 UTC
Assigning to Robin since he has done a bit of work on interpolating landscape images.
Comment 6 Robin Watts 2011-05-27 22:55:25 UTC
Created attachment 7542 [details]
0001.patch

Git patch to add Image interpolation. To apply this, do:

 git am 0001.patch

and that will add a new commit onto the end of your existing branch with the patch applied. You can then remove this by: git reset HEAD~1

This patch seems to test out quite well, but it fails when the clist is used with vertical positioning problems on the contents of bitmaps that span bands.
Comment 8 Robin Watts 2011-06-06 23:33:16 UTC
Passing to Ray in the hopes that he will have a chance to look at it and comment on the offsets seen when sending interpolated sub images to the clist.
Comment 9 Robin Watts 2011-06-06 23:39:15 UTC
Could this be related to Bug 691697 ?
Comment 10 Robin Watts 2011-06-06 23:40:31 UTC
*** Bug 691719 has been marked as a duplicate of this bug. ***
Comment 11 Shailesh Mistry 2011-08-03 21:34:54 UTC
Bug still reproducible in Ghostscript 9.03
Comment 12 Robin Watts 2012-10-26 20:52:52 UTC
Fixed in:

commit 045e544c507b151daebc19aaf21a8b13b6c4a844
Author: Robin Watts <robin.watts@artifex.com>
Date:   Mon Oct 22 17:31:27 2012 +0100

    Support rotated images with interpolation.

    See bug 690246.

    Testing this on the cluster with a patch that enables interpolation
    for all landscape jobs reveals no problems.