Some of my images arnt being turned into image strips :?

70 views
Skip to first unread message

darkflame

unread,
Dec 29, 2012, 5:31:06 PM12/29/12
to Google Web Toolkit
...and thus are rather flickery when animating between them. (they are
frames in a animated sprite).

What baffles me is they are defined the same way as others that do
seem to work.

eg. I have a file like:
public interface MemDayImages extends ClientBundle {
...
@Source("/MemorableDayIcons/MEDIUM/magrietbag0.png")
ImageResource MEDmagrietbag0();

@Source("/MemorableDayIcons/MEDIUM/magrietbag1.png")
ImageResource MEDmagrietbag1();

@Source("/MemorableDayIcons/MEDIUM/magrietbag2.png")
ImageResource MEDmagrietbag2();

...

Which makes a lovely image strip that animates really smoothly.

I have another group of sprites however:

public interface NoirInternalSprites extends ClientBundle {

@Source("com/darkflame/client/JargScene/firelopp/fireloop0050.png")
ImageResource fireloop0050();

@Source("com/darkflame/client/JargScene/firelopp/fireloop0051.png")
ImageResource fireloop0051();

@Source("com/darkflame/client/JargScene/firelopp/fireloop0052.png")
ImageResource fireloop0052();

@Source("com/darkflame/client/JargScene/firelopp/fireloop0053.png")
ImageResource fireloop0053();
...

Which does not.
These pngs instead turn into dozens of separate files - not a image
strip at all.

So what gives :?
What determines when images are combined and when they are not ?

For reference, I use
<set-property name="ClientBundle.enableInlining" value="false" /
>
in my gwt.xml to stop data urls being formed.

Thanks for any pointers,
-Thomas

darkflame

unread,
Jan 8, 2013, 9:54:08 AM1/8/13
to google-we...@googlegroups.com
Still no luck.
If it helps diagnose I can supply sample images.

darkflame

unread,
Jan 20, 2013, 10:30:05 AM1/20/13
to Google Web Toolkit
I'm starting to think...unless I am doing something stupid...this is a
GWT error.
At the very least the behavior contradicts the documentation:

"The ClientBundle generator combines all of the images defined in your
interface into a single, optimized image."

This certainly doesn't seem to be the case. Even without my specific
problem, I am pretty sure many small images would get converted to
DataURLs no?

Sebastián Gurin

unread,
Jan 20, 2013, 11:09:58 AM1/20/13
to google-we...@googlegroups.com
try to prevent any inlining or other optimizations using :

@Source("img0001.png")
@ImageOptions(preventInlining=true)
ImageResource img0001();

From ImageResource.java :

 /**
     * Set to {@code true} to require the ImageResource to be downloaded as a
     * separate resource at runtime. Specifically, this will disable the use of
     * {@code data:} URLs or other bundling optimizations for the image. This
     * can be used for infrequently-displayed images.
     */

Good luck

darkflame

unread,
Jan 20, 2013, 11:27:09 AM1/20/13
to google-we...@googlegroups.com
Thanks I already disabled inlining with :

<set-property name="ClientBundle.enableInlining" value="false" / >

In my gwt.xml, which disables DataURLs, but still doesn't make everything image strips - some are image strips but many are still just separate PNGs images.
I'll try your method as well, but I suspect that also just prevents the DataURLs.

I *think* my problem might be something to do with the filesize of the images, as the ones not being put into strips seem a bit bigger then the rest.  
I'm currently trying to trim them down, but  it would be helpful if there was a specific limit specified in the docs somewhere.

Jens

unread,
Jan 20, 2013, 12:01:06 PM1/20/13
to google-we...@googlegroups.com
There is indeed a max size for image bundles. Take a look at:

You can configure it by setting the system property gwt.imageResource.maxBundleSize to your desired size.

-- J.

Thomas Broyer

unread,
Jan 20, 2013, 12:05:17 PM1/20/13
to google-we...@googlegroups.com


On Sunday, January 20, 2013 5:27:09 PM UTC+1, darkflame wrote:
Thanks I already disabled inlining with :
<set-property name="ClientBundle.enableInlining" value="false" / >

In my gwt.xml, which disables DataURLs, but still doesn't make everything image strips - some are image strips but many are still just separate PNGs images.
I'll try your method as well, but I suspect that also just prevents the DataURLs.

I *think* my problem might be something to do with the filesize of the images, as the ones not being put into strips seem a bit bigger then the rest.  
I'm currently trying to trim them down, but  it would be helpful if there was a specific limit specified in the docs somewhere.

AFAICT it has always been the case (except for the configurability of the threshold, added later).

Feel free to send a patch to improve the documentation.

Thomas Wrobel

unread,
Jan 20, 2013, 1:40:25 PM1/20/13
to google-we...@googlegroups.com
Thanks, but that seems to be a dimension size limit, not a file size limit:

...
if (lossy || toReturn.getHeight() > IMAGE_MAX_SIZE
|| toReturn.getWidth() > IMAGE_MAX_SIZE) {
...

Is there a filesize limit too?
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-web-toolkit/-/qBQDwFz0tmIJ.
>
> To post to this group, send email to google-we...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-tool...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
Reply all
Reply to author
Forward
0 new messages