@ImageOptions

231 views
Skip to first unread message

Hilco Wijbenga

unread,
Jun 21, 2011, 2:00:41 PM6/21/11
to GWT Users
Hi all,

I've been using @ImageOptions to scale (PNG) images. This mostly
worked in GWT 2.2 but now that I've moved to GWT 2.3 most images fail
quietly and don't display (meaning that src="#" instead of the inlined
image at runtime).

public interface MyResources
extends
ClientBundle
{
@Source("org/example/my-image-a.png")
@ImageOptions(width = 118, height = 156)
ImageResource myImageA();
:
@Source("org/example/my-image-b.png")
@ImageOptions(width = 130)
ImageResource myImageB();
}

There does not seem to be any rule (AFAICT) that determines which
images work and which don't. What always seems to work is
@ImageOptions (i.e. no scaling) and @ImageOptions(width = W, height =
H) (where H and W are the actual height and width of the image). Other
values might or might not work. (It's quite deterministic though, the
same number(s) for the same image either work or they don't, it
doesn't change from run to run).

I intend to scale the images myself to work around the problem but I
would like to understand what the root cause is and why there are no
error messages. Any ideas?

Cheers,
Hilco

Thomas Broyer

unread,
Jun 21, 2011, 9:56:35 PM6/21/11
to google-we...@googlegroups.com
Could it rather be about how you *use* the ImageResource? See http://code.google.com/p/google-web-toolkit/issues/detail?id=6145
Reply all
Reply to author
Forward
0 new messages