You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2015/07/29 13:42:32 UTC

[Bug 58190] New: The current picture handling uses raw integers for types and index, replace with enum and reference

https://bz.apache.org/bugzilla/show_bug.cgi?id=58190

            Bug ID: 58190
           Summary: The current picture handling uses raw integers for
                    types and index, replace with enum and reference
           Product: POI
           Version: 3.13-dev
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: XSLF
          Assignee: dev@poi.apache.org
          Reporter: Mark.Olesen@gmx.net

It is much too easy to make errors when dealing with images.
Introduce enums (for image types and relations).
Provide thin wrapper to reference the document image number.

Patched code provided as a discussion and/or implementation basis.
Need to decide how much compatibilty to retain.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 58190] The current picture handling uses raw integers for types and index, replace with enum and reference

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58190

--- Comment #4 from mark.o <Ma...@gmx.net> ---
No problems with the handling - the main thing is that the integers index is
gone, everything else should be encapsulated enough that nobody is bothered.

BTW: the PictureType enum has an "ooxml-id". I don't know that this is
necessary at all. I believe it was only the integer value into the previous
RELATIONS[] lookup, but doesn't have any intrinsic meaning ... it certainly
isn't used anywhere in the code.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 58190] The current picture handling uses raw integers for types and index, replace with enum and reference

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58190

Andreas Beeker <ki...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #3 from Andreas Beeker <ki...@apache.org> ---
Thank you for bringing this up.
I've changed a few things - I hope the new handling is ok for you.
Applied with r1693825

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 58190] The current picture handling uses raw integers for types and index, replace with enum and reference

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58190

--- Comment #1 from mark.o <Ma...@gmx.net> ---
Created attachment 32942
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=32942&action=edit
patch as basic coding example

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 58190] [PATCH] The current picture handling uses raw integers for types and index, replace with enum and reference

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58190

Javen O'Neal <on...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|---                         |FIXED

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 58190] The current picture handling uses raw integers for types and index, replace with enum and reference

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58190

--- Comment #2 from Andreas Beeker <ki...@apache.org> ---
Created attachment 32952
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=32952&action=edit
Patch for X/HSLF which uses the (H/XSLF)PictureData element

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 58190] The current picture handling uses raw integers for types and index, replace with enum and reference

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58190

mark.o <Ma...@gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |---
             Status|RESOLVED                    |REOPENED

--- Comment #5 from mark.o <Ma...@gmx.net> ---
(In reply to Andreas Beeker from comment #3)
> Thank you for bringing this up.
> I've changed a few things - I hope the new handling is ok for you.
> Applied with r1693825

I've reopened with a patch for improved consistency/convenience.
I assume that I'll like many users and my image source is file-based. In this
case it makes sense to support this directly (as is already done in
HSLFSlideShow). I personally find this is much clearer.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 58190] [PATCH] The current picture handling uses raw integers for types and index, replace with enum and reference

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58190

--- Comment #7 from Dominik Stadler <do...@gmx.at> ---
Applied via r1745073, thanks for the work on the patches. It would be good if
you can add some unit-tests which cover these new methods so we can close this
bug for good!

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 58190] [PATCH] The current picture handling uses raw integers for types and index, replace with enum and reference

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58190

Javen O'Neal <on...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |59836

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 58190] [PATCH] The current picture handling uses raw integers for types and index, replace with enum and reference

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58190

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |PatchAvailable
            Summary|The current picture         |[PATCH] The current picture
                   |handling uses raw integers  |handling uses raw integers
                   |for types and index,        |for types and index,
                   |replace with enum and       |replace with enum and
                   |reference                   |reference

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 58190] The current picture handling uses raw integers for types and index, replace with enum and reference

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58190

mark.o <Ma...@gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #32942|0                           |1
        is obsolete|                            |

--- Comment #6 from mark.o <Ma...@gmx.net> ---
Created attachment 32954
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=32954&action=edit
addPicture() with File and InputStream parameters

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 58190] [PATCH] The current picture handling uses raw integers for types and index, replace with enum and reference

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58190

Javen O'Neal <on...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |NEEDINFO

--- Comment #8 from Javen O'Neal <on...@apache.org> ---
(In reply to Dominik Stadler from comment #7)
> Applied via r1745073, thanks for the work on the patches. It would be good
> if you can add some unit-tests which cover these new methods so we can close
> this bug for good!

Added some unit tests for SlideShow#findPicture and SlideShow.addPicture in
r1753065 and r1753073. Is there anything else that needs a unit test in order
to close this bug?

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 58190] [PATCH] The current picture handling uses raw integers for types and index, replace with enum and reference

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58190

Javen O'Neal <on...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|Linux                       |All

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org