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 2009/01/21 05:58:06 UTC

DO NOT REPLY [Bug 46569] New: Image is reversed on a very wide column.

https://issues.apache.org/bugzilla/show_bug.cgi?id=46569

           Summary: Image is reversed on a very wide column.
           Product: POI
           Version: 3.1
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: poojapk_30@yahoo.co.in


Created an attachment (id=23146)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23146)
sample program to demonstrate issue

I am creating and excel worksheet , the width of whose columns may vary. There
is an image on the top row - anchores to one of the last columns of the sheet. 
When the width of the column containing the image is very wide (say 1000
pixels), the image is reversed and placed on the column before the column where
the image is anchored. A sample program to demonstrate the issue is attached.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 46569] Image is reversed on a very wide column.

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


Pooja <po...@yahoo.co.in> changed:

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




--- Comment #3 from Pooja <po...@yahoo.co.in>  2009-02-04 23:06:43 PST ---
Created an attachment (id=23231)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23231)
updated standalone sample junit to demonstrate the problem


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 46569] Image is reversed on a very wide column.

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


Yegor Kozlov <ye...@dinom.ru> changed:

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




--- Comment #6 from Yegor Kozlov <ye...@dinom.ru>  2009-02-06 10:40:37 PST ---
Nick's supposition is right, it is a signed vs unsiged 16 bit integer issue.

1. The following fragment (lines 64-66) is wrong:

                float cellWidth = convertPixelsToCharacters(columnWidths[c] *
256f);

                sheet.setColumnWidth((short) (columnIndex), (short) cellWidth);

If cellWidth > Short.MAX_VALUE then the casting to short produces a negative
value.

2. setColumnWidth / getColumnWidth with short arguments are deprecated. 
Use
setColumnWidth(int columnIndex, int width) 
and 
int getColumnWidth(int columnIndex) 

In particular, getColumnWidth(short columnIndex)  return a short value. If
column width measured in 1/256th units is in the interval [32767, 65536] 
then this method returns a negative value which is evidently incorrect.

3. The maximum column width for an individual cell in Excel is 255 characters.
I changed the code to throw IllegalArgumentException if this limit is exceeded.

Regards,
Yegor


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 46569] Image is reversed on a very wide column.

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





--- Comment #4 from Pooja <po...@yahoo.co.in>  2009-02-04 23:09:48 PST ---
Created an attachment (id=23232)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23232)
Image used by sample program

Please update the path of the image file on line 91 of the sample program to
point to this image file.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 46569] Image is reversed on a very wide column.

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





--- Comment #1 from Nick Burch <ni...@torchbox.com>  2009-01-21 03:06:28 PST ---
I haven't looked into this at all, but I wonder if it might be a signed vs
unsiged 16 bit integer issue. That'd be my first hunch on where to investigate


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 46569] Image is reversed on a very wide column.

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


Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO




--- Comment #2 from Yegor Kozlov <ye...@dinom.ru>  2009-02-02 07:20:35 PST ---
Your sample programs uses unresolved
ReportWriterHelper.convertPixelsToCharacters and
ReportWriterHelper.convertPixelsToPoints. Please re-attach an isolated test
case. 
Also attach the image you are using for the header. 

Yegor


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 46569] Image is reversed on a very wide column.

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


Pooja <po...@yahoo.co.in> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW




--- Comment #5 from Pooja <po...@yahoo.co.in>  2009-02-04 23:14:03 PST ---
The standalone junit to demonstrate the issue and the image file used are
uploaded. 
Please update file path in line 91 of sample program to point to the image file
attached.
If you comment line 46 where the width of the column is set to a very large
value, the excel generated has the image placed properly. Uncomment it and the
image in the excel is reversed.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 46569] Image is reversed on a very wide column.

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





--- Comment #7 from Josh Micich <jo...@gildedtree.com>  2009-02-06 18:07:07 PST ---
(In reply to comment #6)
> ...
> 3. The maximum column width for an individual cell in Excel is 255 characters.
> I changed the code to throw IllegalArgumentException if this limit is exceeded.
> ...

svn r741678 ( https://svn.apache.org/viewcvs.cgi?view=rev&rev=741678 )

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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