commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (Jira)" <j...@apache.org>
Subject [jira] [Work logged] (IMAGING-236) Add support to read multiple images from GIF
Date Sat, 02 Nov 2019 13:02:00 GMT

     [ https://issues.apache.org/jira/browse/IMAGING-236?focusedWorklogId=337693&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-337693
]

ASF GitHub Bot logged work on IMAGING-236:
------------------------------------------

                Author: ASF GitHub Bot
            Created on: 02/Nov/19 13:01
            Start Date: 02/Nov/19 13:01
    Worklog Time Spent: 10m 
      Work Description: christoffer-rydberg commented on pull request #55: [IMAGING-236] Add
support to read multiple images from GIF
URL: https://github.com/apache/commons-imaging/pull/55#discussion_r341810493
 
 

 ##########
 File path: src/test/java/org/apache/commons/imaging/formats/gif/GifReadTest.java
 ##########
 @@ -57,10 +58,40 @@ public void testImageInfo() throws Exception {
         // TODO assert more
     }
 
+    @Test
+    public void testImageDimensions() throws Exception {
+        final ImageInfo imageInfo = Imaging.getImageInfo(imageFile);
+        final GifImageMetadata metadata = (GifImageMetadata) Imaging.getMetadata(imageFile);
+        final List<BufferedImage> images = Imaging.getAllBufferedImages(imageFile);
+
+        int width = 0;
+        int height = 0;
+        for(int i = 0; i < images.size(); i++) {
+            final BufferedImage image = images.get(i);
+            final GifImageMetadataItem metadataItem = metadata.getItems().get(i);
+            final int xOffset = metadataItem.getLeftPosition();
+            final int yOffset = metadataItem.getTopPosition();
+            width = Math.max(width, image.getWidth() + xOffset);
+            height = Math.max(height, image.getHeight() + yOffset);
+        }
+
+        assertEquals(width, metadata.getWidth());
+        assertEquals(height, metadata.getHeight());
+        assertEquals(width, imageInfo.getWidth());
+        assertEquals(height, imageInfo.getHeight());
 
 Review comment:
   The first two asserts are for the metadata and the second two are for the image info. It's
just to ensure the width/height is correctly set in both.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 337693)
    Time Spent: 1h 40m  (was: 1.5h)

> Add support to read multiple images from GIF
> --------------------------------------------
>
>                 Key: IMAGING-236
>                 URL: https://issues.apache.org/jira/browse/IMAGING-236
>             Project: Commons Imaging
>          Issue Type: Improvement
>          Components: Format: GIF
>            Reporter: Bruno P. Kinoshita
>            Assignee: Bruno P. Kinoshita
>            Priority: Minor
>             Fix For: 1.0-alpha2
>
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> Placeholder for https://github.com/apache/commons-imaging/pull/55



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message