~hjd/ubuntu/wily/xmlgraphics-commons/debian-merged

« back to all changes in this revision

Viewing changes to src/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderRawCCITTFax.java

  • Committer: Hans Joachim Desserud
  • Date: 2015-11-11 18:22:53 UTC
  • mfrom: (9.1.5 sid)
  • Revision ID: hans_joachim_desserud-20151111182253-zwi0frfm97j0wddn
  * Merge from Debian unstable.  Remaining changes:
    - d/control: Drop dependencies required for unit testing as they
      include libmockito-java which would pull maven into main, disable unit
      test execution.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 * limitations under the License.
16
16
 */
17
17
 
18
 
/* $Id: ImageLoaderRawCCITTFax.java 1177544 2011-09-30 07:58:51Z phancock $ */
 
18
/* $Id: ImageLoaderRawCCITTFax.java 1681698 2015-05-26 07:49:35Z ssteiner $ */
19
19
 
20
20
package org.apache.xmlgraphics.image.loader.impl;
21
21
 
42
42
import org.apache.xmlgraphics.image.loader.ImageSessionContext;
43
43
import org.apache.xmlgraphics.image.loader.util.ImageUtil;
44
44
import org.apache.xmlgraphics.image.loader.util.SeekableStreamAdapter;
 
45
import org.apache.xmlgraphics.io.XmlSourceUtil;
45
46
import org.apache.xmlgraphics.util.MimeConstants;
46
47
import org.apache.xmlgraphics.util.io.SubInputStream;
47
48
 
56
57
    private static final int COMPRESSION_FAX_GROUP4 = 4;
57
58
 
58
59
    /** logger */
59
 
    protected static Log log = LogFactory.getLog(ImageLoaderRawCCITTFax.class);
 
60
    protected static final Log log = LogFactory.getLog(ImageLoaderRawCCITTFax.class);
60
61
 
61
62
    /**
62
63
     * Main constructor.
139
140
        }
140
141
 
141
142
        in.seek(stripOffset);
142
 
        InputStream subin = new SubInputStream(ImageUtil.needInputStream(src), stripLength, true);
 
143
        InputStream subin = new SubInputStream(XmlSourceUtil.needInputStream(src), stripLength, true);
143
144
        if (fillOrder == 2) {
144
145
            //Decorate to flip bit order
145
146
            subin = new FillOrderChangeInputStream(subin);
146
147
        }
147
148
        ImageRawCCITTFax rawImage = new ImageRawCCITTFax(info, subin, compression);
148
149
        //Strip stream from source as we pass it on internally
149
 
        ImageUtil.removeStreams(src);
 
150
        XmlSourceUtil.removeStreams(src);
150
151
        return rawImage;
151
152
    }
152
153