commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Damjan Jovanovic (JIRA)" <>
Subject [jira] [Resolved] (IMAGING-94) Add ability to load partial TIFF images
Date Wed, 12 Dec 2012 05:43:21 GMT


Damjan Jovanovic resolved IMAGING-94.

       Resolution: Fixed
    Fix Version/s: 1.0

Thank you very much for your patch Gary, I've committed it now :).

Resolving fixed.

> Add ability to load partial TIFF images
> ---------------------------------------
>                 Key: IMAGING-94
>                 URL:
>             Project: Commons Imaging
>          Issue Type: New Feature
>          Components: Format: TIFF
>            Reporter: Gary Lucas
>             Fix For: 1.0
>         Attachments: LucasTrackerItem94_Oct14.patch, LucasTrackerItem94_Oct24.patch
> For most Apache Commons Imaging applications, the easiest way to obtain a sub image from
a file is to simply use the Imaging class to load it as a BufferedImage and then use BufferedImage’s
getSubimage() method to extract the portion of the image you wish to use.  The TIFF format
presents a special problem because it is very common to have huge images (100’s or even
1000’s of megapixel).  Examples include Landsat satellite images, global-scale GeoTIFF images,
etc.  In such cases, loading the entire image into memory is not practical because it would
require too much memory.  For example, I am currently working with a 21600 by 10800 image
that requires more than 890 megabytes to store as a BufferedImage.  That value is pushing
the limit of what I can configure Java to handle on my particular OS.
> I propose to implement features for TIFF files that would permit Commons Imaging to load
a partial image of a TIFF file using only the amount memory actually needed to hold the sub-image.
> These changes would not interfere with normal operations of TIFF files and would not
affect other image formats.  If there were a need for similar features for other image formats,
they could be phased in through future changes.
> The specification for a sub-image would be through the use of the params argument in
the getBufferedImage call as follows:
>         HashMap<String, Object> params = new HashMap<String, Object>();
>         params.put(TiffConstants.PARAM_KEY_SUBIMAGE_X, new Integer( x ));
>         params.put(TiffConstants.PARAM_KEY_SUBIMAGE_Y, new Integer( y ));
>         params.put(TiffConstants.PARAM_KEY_SUBIMAGE_WIDTH, new Integer(width));
>         params.put(TiffConstants.PARAM_KEY_SUBIMAGE_HEIGHT, new Integer(height));

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message