ImageResource, Sprites and "Data:" URL

141 views
Skip to first unread message

Gaurav Vaish

unread,
Oct 16, 2011, 10:37:34 PM10/16/11
to Google Web Toolkit
Hi,

Is there any option to force use the generated sprite image instead of
the "data:image/*" URL?

As I understand, the only reason to use "data:" URL is to avoid extra
connection to the server.
However, if an sprite has been created (and my sprite has around 150
images combined in), I'd prefer using that image.

One extra connection for this, IMHO - specially in my case, is better
than dumping in all 400KB of data in the HTML image that increases the
payload and initial load-time by a huge amount (my basic HTML is only
a few KBs, not even 100's of KBs)



Happy Hacking,
Gaurav Vaish
http://www.mastergaurav.com

Thomas Broyer

unread,
Oct 17, 2011, 3:56:54 AM10/17/11
to google-we...@googlegroups.com
Simply add <set-property name="ClientBundle.enableInlining" value="false" /> to your gwt.xml. See http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.html#Levers_and_knobs

Nicolas Antoniazzi

unread,
Oct 17, 2011, 5:52:22 AM10/17/11
to google-we...@googlegroups.com
If your resource is declared from an interface, you can use a @DoNotEmbed annotation above specific resources instead of disabling it for all your application.

Simply add <set-property name="ClientBundle.enableInlining" value="false" /> to your gwt.xml. See http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.html#Levers_and_knobs

--
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/-/jh6jFaFGSk4J.

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.

Gaurav Vaish

unread,
Oct 17, 2011, 11:39:20 PM10/17/11
to Google Web Toolkit
Oops! I think I replied to the individuals last time ;)

Here's a summary:

@DoNotEmbed is only for DataResource and not for any
ResourcePrototype. Looked at the code of ImageResourceGenerator which
says "forceInline = false" always, without caring about DoNotEmbed.
IMHO, a simple change to this effect will be very useful.

ClientBundle.enableInlining was the only option that worked, but
sadly, it disables at a "global" level. It works for my case, so I'm
ok with it...


--
Happy Hacking,
Gaurav Vaish
http://www.mastergaurav.com



On Oct 17, 2:52 pm, Nicolas Antoniazzi <nicolas.antonia...@gmail.com>
wrote:
> If your resource is declared from an interface, you can use a @DoNotEmbed
> annotation above specific resources instead of disabling it for all your
> application.
>
> http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/...
>
> 2011/10/17 Thomas Broyer <t.bro...@gmail.com>
>
>
>
>
>
>
>
> > Simply add <set-property name="ClientBundle.enableInlining" value="false"
> > /> to your gwt.xml. See
> >http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.htm...
Reply all
Reply to author
Forward
0 new messages