Re: What happened to composite images for ClientBundles?

2012-09-20 Thread Chris Lercher
On Thursday, September 20, 2012 3:54:41 AM UTC+2, Tim wrote:
>
> Perhaps you want set some ImageOptions on the resource.  Check 
> "preventInlining" and "RepeatStyle" 
>
>
Thanks, according to the javadoc, ImageOptions.preventInlining actually 
seems to disable all kinds of optimizations:

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. 


I assume, this also includes spriting (?). A quick look at 
com.google.gwt.resources.rg.ImageResourceGenerator seems to confirm this 
for the current implementation.

It's a bit counter-intuitive, because the option is just called 
"preventInlining", so to be on the safe side, I'll probably use a 
DataResource instead (I might miss ImageResource's getWidth()/getHeight() 
methods though).

And about RepeatStyle.Both: Here, the javadoc says:

 The image is intended to be tiled both horizontally and vertically. Note
>
> that this will prevent compositing of the particular image *in most cases*
> .
>
>  

>  

-- 
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/-/lCqKpfXTALYJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: What happened to composite images for ClientBundles?

2012-09-19 Thread Tim
Perhaps you want set some ImageOptions on the resource.  Check 
"preventInlining" and "RepeatStyle" 

On Wednesday, September 19, 2012 8:30:46 AM UTC-7, Chris Lercher wrote:
>
> According to 
> https://developers.google.com/web-toolkit/doc/latest/DevGuideUiImageBundles, 
> multiple images in the same ClientBundle should usually be merged to a 
> composite image, quote:
>
> Multiple ImageResources are declared in a single ClientBundle, which is a 
>> composition of many images into a single image
>
>
> And I remember, that I tried and confirmed this, when I first used it a 
> few years ago. But I don't see this happening anymore:
>
> - Either we get data URIs (for small images), 
> - or we get separate "*.cache.jpg" images for each ImageResource in the 
> ClientBundle (for large images, or if setting  name="ClientBundle.enableInlining" value="false"/>)
>
> Is this correct, or is it a bug? Can I maybe even rely on GWT not 
> producing composite images anymore [*]?
>
> [*] This would allow me to use "new Image(imageResource.getSafeUri())", 
> which would be useful in certain circumstances (e.g. when printing the 
> page), as it uses a foreground image instead of a background image.
>

-- 
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/-/cuUhLhz0M6wJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: What happened to composite images for ClientBundles?

2012-09-19 Thread Thomas Broyer


On Wednesday, September 19, 2012 5:30:46 PM UTC+2, Chris Lercher wrote:
>
> According to 
> https://developers.google.com/web-toolkit/doc/latest/DevGuideUiImageBundles, 
> multiple images in the same ClientBundle should usually be merged to a 
> composite image, quote:
>
> Multiple ImageResources are declared in a single ClientBundle, which is a 
>> composition of many images into a single image
>
>
> And I remember, that I tried and confirmed this, when I first used it a 
> few years ago. But I don't see this happening anymore:
>
> - Either we get data URIs (for small images), 
> - or we get separate "*.cache.jpg" images for each ImageResource in the 
> ClientBundle (for large images, or if setting  name="ClientBundle.enableInlining" value="false"/>)
>
> Is this correct, or is it a bug?
>

That's correct. As KevMo says, "spriting" is actually only used for IE6/7.
 

> Can I maybe even rely on GWT not producing composite images anymore [*]?
>
> [*] This would allow me to use "new Image(imageResource.getSafeUri())", 
> which would be useful in certain circumstances (e.g. when printing the 
> page), as it uses a foreground image instead of a background image.
>

You shouldn't (not that I can think of anything that would make us change 
the way it is though; note however that technically it depends on the exact 
generator being used, so it's easy to break code that makes such 
assumptions by only changing the *.gwt.xml)
If you want to do a "new Image(someResourceInAClientBundle.getSafeUri())", 
you'd better use a DataResource.

-- 
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/-/FJAKw94e1tIJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: What happened to composite images for ClientBundles?

2012-09-19 Thread KevMo
I believe it still makes composite images for older versions of IE, as 
those don't support data URIs. 

On Wednesday, September 19, 2012 8:30:46 AM UTC-7, Chris Lercher wrote:
>
> According to 
> https://developers.google.com/web-toolkit/doc/latest/DevGuideUiImageBundles, 
> multiple images in the same ClientBundle should usually be merged to a 
> composite image, quote:
>
> Multiple ImageResources are declared in a single ClientBundle, which is a 
>> composition of many images into a single image
>
>
> And I remember, that I tried and confirmed this, when I first used it a 
> few years ago. But I don't see this happening anymore:
>
> - Either we get data URIs (for small images), 
> - or we get separate "*.cache.jpg" images for each ImageResource in the 
> ClientBundle (for large images, or if setting  name="ClientBundle.enableInlining" value="false"/>)
>
> Is this correct, or is it a bug? Can I maybe even rely on GWT not 
> producing composite images anymore [*]?
>
> [*] This would allow me to use "new Image(imageResource.getSafeUri())", 
> which would be useful in certain circumstances (e.g. when printing the 
> page), as it uses a foreground image instead of a background image.
>

-- 
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/-/OYaOmE7r3M8J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.