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 Fri, 01 Nov 2019 23:30:00 GMT

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

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

                Author: ASF GitHub Bot
            Created on: 01/Nov/19 23:29
            Start Date: 01/Nov/19 23:29
    Worklog Time Spent: 10m 
      Work Description: kinow 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_r341782550
 
 

 ##########
 File path: src/main/java/org/apache/commons/imaging/formats/gif/GifImageParser.java
 ##########
 @@ -439,6 +439,16 @@ private GifBlock findBlock(final List<GifBlock> blocks, final
int code) {
         return null;
     }
 
+    private <T extends GifBlock> List<T> findAllBlocks(final List<GifBlock>
blocks, final int code) {
+        final List<T> filteredBlocks = new ArrayList<>();
+        for (final GifBlock gifBlock : blocks) {
+            if (gifBlock.blockCode == code) {
+                filteredBlocks.add((T) gifBlock);
 
 Review comment:
   Just re-read the `GifImageParser#readBlocks()`, and actually I believe the only way this
could happen, is if the `switch/case` logic was wrong, and used the wrong class for a block
code. So this should be fine, especially as this appears to be internal use only.
   
   So maybe just add the suppress annotation and a note, e.g.
   
   ```
   // See GifImageParser#parse for reference how the blocks are created. They should match
   // the code we are giving here, returning the correct class type. Internal only.
   @SuppressWarnings("unchecked")
   private <T extends GifBlock> List<T> findAllBlocks(final List<GifBlock>
blocks, final int code) {
   ```
   
   ?
 
----------------------------------------------------------------
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: 337617)
    Time Spent: 1h 20m  (was: 1h 10m)

> 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 20m
>  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