Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Problem with DecorationOverlayIcon
Problem with DecorationOverlayIcon [message #134637] Tue, 02 June 2009 10:08 Go to next message
Dmitry Pryadkin is currently offline Dmitry PryadkinFriend
Messages: 146
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------020900090006040902090000
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hello everybody,

Recently I've experienced a strange problem. I have a TableViewer with
decorated icons in its items.

At some point I call ColumnViewer#refresh to update decorations.

I'm receiving com.sun.imageio.plugins.png.PNGImageReader exception.
Stack trace is provided along with the png image.

com.sun.imageio.plugins.png.PNGImageReader#readImage at 1253 has thrown
an IOException from decodeImage().



--------------020900090006040902090000
Content-Type: application/x-zip-compressed;
name="overlays.zip"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="overlays.zip"

UEsDBAoAAAAAAFR4wjqWW+XwFAIAABQCAAAPACQALTE4Mjg3MTI1MDgucG5n CgAgAAAAAAAB
ABgABi6t4GDjyQFpBL0EZ+PJAWkEvQRn48kBiVBORw0KGgoAAAANSUhEUgAA ABAAAAAQCAYA
AAAf8/9hAAAB20lEQVR4nGNgGBRg7dq1/zdv3vx/wYIF/ydOnPi/u7sbK25q avpfWlr6PyMj
4z+KASDNIBAUFPQfBpDZ6PzY2FhUA+bPn//f19cXA3t5eWFgd3f3/wEBAagG TJo0CWzyzJkz
/8888x+MY6oQbBh/xun/YAwyCMWAnp6e/0+fPv3f0dHxv2PrIzAOyGr937Lh Dhg3rL353yet
8X/tymtg7ObmhmkAuguigTZOP/UfjiMqZv6fdOw/GIO8gWIAKIRv3779v7Gx 6X/Dmhtg7JVS
/79q2WUwLlt4/r9rQvX/onlnwBjDBU+uLfzfFccPxiD2lJNAG8tn/p8AtA2G Q0pngl1p0HwN
TKMYANJ48uzF/+WVNWBDSuaf/e8SV/W/cO4ZMEYG0XPv/b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XjKGJTS8s v4T7U9+Y8znu
+UZag+c+rKkx1Vat59d3bJem6r/PWZOr5zeCmM+HW0BEt2U10vObZWvjwDrr 5SOvubv5vkIG
RHqWVjs/1MAqTfP4gNNqOPqzxlC4D99L5I410TxJCI70S3WeLghW18kw1mJn LvY1Ffy4Ut+a
FjVTOpr/NQp3M34bNXJG6Y2Gp069otrU+44zQvLZWOvdpnTzmjS/+g2fwFVS /wZQSwECGQAK
AAAAAABUeMI6llvl8BQCAAAUAgAADwAAAAAAAAAAACAAAAAAAAAALTE4Mjg3 MTI1MDgucG5n
UEsBAhkAFAAAAAgAyHzCOuUiYaq5BQAAFBYAAAkAAAAAAAAAAAAgAAAAZQIA AHN0YWNrLnR4
dFBLBQYAAAAAAgACAHQAAABpCAAAAAA=
--------------020900090006040902090000--
Re: Problem with DecorationOverlayIcon [message #134650 is a reply to message #134637] Tue, 02 June 2009 10:50 Go to previous messageGo to next message
Dmitry Pryadkin is currently offline Dmitry PryadkinFriend
Messages: 146
Registered: July 2009
Senior Member
I've been reading comments by Frank Appel in
ResourceFactory#createImage. The following testcase shows that the
approach is erroneous.

The img.png is the one I attached to my referenced message.

try
{
InputStream inputStream = new FileInputStream("c:\\img.png");

BufferedInputStream bis = new BufferedInputStream( inputStream );


try
{
ImageIO.setUseCache( false );
BufferedImage buf = ImageIO.read(bis);
}
catch (IOException e)
{
e.printStackTrace();
}
}
catch (FileNotFoundException e)
{
e.printStackTrace();
}

Dmitry Pryadkin wrote:
> Hello everybody,
>
> Recently I've experienced a strange problem. I have a TableViewer with
> decorated icons in its items.
>
> At some point I call ColumnViewer#refresh to update decorations.
>
> I'm receiving com.sun.imageio.plugins.png.PNGImageReader exception.
> Stack trace is provided along with the png image.
>
> com.sun.imageio.plugins.png.PNGImageReader#readImage at 1253 has thrown
> an IOException from decodeImage().
>
>
Re: Problem with DecorationOverlayIcon [message #134714 is a reply to message #134650] Tue, 02 June 2009 11:35 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
The image itself seems to cause the problem. Reading it directly
also results in an exception:
InputStream inputStream = new FileInputStream( "c:\\imgage.png" );
ImageIO.read( inputStream );
raises the same exception as your code.
Some image-viewing-progreams also refuse to show the image.

Dmitry Pryadkin wrote:
> I've been reading comments by Frank Appel in
> ResourceFactory#createImage. The following testcase shows that the
> approach is erroneous.
>
> The img.png is the one I attached to my referenced message.
>
> try
> {
> InputStream inputStream = new FileInputStream("c:\\img.png");
> BufferedInputStream bis = new BufferedInputStream( inputStream );
>
> try
> {
> ImageIO.setUseCache( false );
> BufferedImage buf = ImageIO.read(bis);
> }
> catch (IOException e)
> {
> e.printStackTrace();
> }
> }
> catch (FileNotFoundException e)
> {
> e.printStackTrace();
> }
>
> Dmitry Pryadkin wrote:
>> Hello everybody,
>>
>> Recently I've experienced a strange problem. I have a TableViewer with
>> decorated icons in its items.
>>
>> At some point I call ColumnViewer#refresh to update decorations.
>>
>> I'm receiving com.sun.imageio.plugins.png.PNGImageReader exception.
>> Stack trace is provided along with the png image.
>>
>> com.sun.imageio.plugins.png.PNGImageReader#readImage at 1253 has
>> thrown an IOException from decodeImage().
>>
>>
Re: Problem with DecorationOverlayIcon [message #134727 is a reply to message #134714] Tue, 02 June 2009 11:44 Go to previous messageGo to next message
Dmitry Pryadkin is currently offline Dmitry PryadkinFriend
Messages: 146
Registered: July 2009
Senior Member
Rüdiger,

The point is that it was not me who generated this image. It was
composed by DecorationOverlayIcon from the parts.



Rüdiger Herrmann wrote:
> The image itself seems to cause the problem. Reading it directly also
> results in an exception:
> InputStream inputStream = new FileInputStream( "c:\\imgage.png" );
> ImageIO.read( inputStream );
> raises the same exception as your code.
> Some image-viewing-progreams also refuse to show the image.
>
> Dmitry Pryadkin wrote:
>> I've been reading comments by Frank Appel in
>> ResourceFactory#createImage. The following testcase shows that the
>> approach is erroneous.
>>
>> The img.png is the one I attached to my referenced message.
>>
>> try
>> {
>> InputStream inputStream = new FileInputStream("c:\\img.png");
>> BufferedInputStream bis = new BufferedInputStream( inputStream );
>>
>> try
>> {
>> ImageIO.setUseCache( false );
>> BufferedImage buf = ImageIO.read(bis);
>> }
>> catch (IOException e)
>> {
>> e.printStackTrace();
>> }
>> }
>> catch (FileNotFoundException e)
>> {
>> e.printStackTrace();
>> }
>>
>> Dmitry Pryadkin wrote:
>>> Hello everybody,
>>>
>>> Recently I've experienced a strange problem. I have a TableViewer
>>> with decorated icons in its items.
>>>
>>> At some point I call ColumnViewer#refresh to update decorations.
>>>
>>> I'm receiving com.sun.imageio.plugins.png.PNGImageReader exception.
>>> Stack trace is provided along with the png image.
>>>
>>> com.sun.imageio.plugins.png.PNGImageReader#readImage at 1253 has
>>> thrown an IOException from decodeImage().
>>>
>>>
Re: Problem with DecorationOverlayIcon [message #134740 is a reply to message #134727] Tue, 02 June 2009 12:27 Go to previous messageGo to next message
Markus  rüger is currently offline Markus rügerFriend
Messages: 369
Registered: July 2009
Senior Member
Hi,
we experienced the same problem a few weeks ago. The problem was, that one
of the images (the icon itself, or the icon to overlay with) had a
transparent area. Some image software, like photoshop, can save the image in
a way it can not be read properly (transperency set to "on" and no
background color). To fix this in photoshop for example you can save for
web, than activate the checkbox for transperency, if not already activate,
and set background to be "white". This solved our problem.

Hope that helps.

Regards,
Markus

"Dmitry Pryadkin" <drpadawan@ya.ru> schrieb im Newsbeitrag
news:h033a5$brs$1@build.eclipse.org...
> R
Re: Problem with DecorationOverlayIcon [message #134829 is a reply to message #134740] Wed, 03 June 2009 12:39 Go to previous message
Dmitry Pryadkin is currently offline Dmitry PryadkinFriend
Messages: 146
Registered: July 2009
Senior Member
Thanks, I'll check this out

Markus Krüger wrote:
> Hi,
> we experienced the same problem a few weeks ago. The problem was, that one
> of the images (the icon itself, or the icon to overlay with) had a
> transparent area. Some image software, like photoshop, can save the image in
> a way it can not be read properly (transperency set to "on" and no
> background color). To fix this in photoshop for example you can save for
> web, than activate the checkbox for transperency, if not already activate,
> and set background to be "white". This solved our problem.
Previous Topic:RightToLeft
Next Topic:How to use upload widgets
Goto Forum:
  


Current Time: Sat Apr 20 02:13:04 GMT 2024

Powered by FUDForum. Page generated in 0.03051 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top