Hi Thomas,

Is there a reason why the generator doesn't combine all the images into one
image automatically?  Or maybe one for each theme and one for the app?

John

-----Original Message-----
From: thron7 [mailto:[email protected]] 
Sent: 11 August 2010 10:00
To: qooxdoo Development
Subject: Re: [qooxdoo-devel] Combine images from modern theme for GAE
deployment.



On 08/10/2010 07:08 PM, eduardo zuviria wrote:
> Hi,
> 
> I'm working in deploying a qooxdoo (version 1.2) app in the Google app
> engine. For optimization reasons i want to combine the 
> modern theme images in a only a few files and I'm not interest in
> compatibility with IE6. But for some reason that i coudn't figure out,
> the application is still referencing the individual images and not the
> combined files. (Tried using different browsers).

The information about the combined images is conferred at compile time.
The application has to be built with the "knowledge" that there are
combined images. See further down.

> I look at some threads in the forum but no luck finding the reason.
> 
> This is what i'm doing:
> 
> - create a default  qooxdoo app, test2.
> 
> - copy the images from the modern theme to a folder
> ./source/images/test2/Modern

This is your first mistake. Resources, like images, have to go into the
source/resource folder (or, more exactly, the sub-path that is specified
in your Manifest.json for resources, which is usually
'source/resource'). Beneath this folder, everything has to start with a
name space (this was your second mistake). So (as I don't assume your
application has the name space "images"), the path should look somewhat
like this

  ./source/resource/myapp/images/test2/Modern


> 
> - combine images (only using the form folder with the button images just
> for testing), this is my image.json file:

Third: In order to create combined images, you don't have to copy the
source images around. In your image.json, just give their source path,
and specify the output (combined) file in your own resource path. Still,
the combined image must have your app's name space.

> 
> - run generate.py -c image.json image-combine, it generates the combine
> image with the meta file:
> 
> {"test2/Modern/form/button-b.png": [4, 4, "png",
> "test2/combined/form-combined.png", -915, 0], rest of file ....

This looks basically ok, but as I said it's in the wrong path, and it
contains probably the wrong resource id's, depending on what your are
trying to achieve.

> 
> /*
************************************************************************
> 
> 
> #asset(test2/Modern/*)

You have to use *resource id's* here. A resource id starts with a name
space, down to the file name, optionally shortened by a glob. So this
should rather be

  #asset(myapp/images/test2/Modern/*)


> #asset(qx/icon/Tango/16/places/folder-open.png)
> #asset(qx/icon/Tango/16/places/folder.png)
> #asset(qx/icon/Tango/16/mimetypes/office-document.png)
> 
> #asset(qx/icon/Tango/16/actions/window-close.png)
> 
> #asset(qx/icon/Tango/22/places/folder-open.png)
> #asset(qx/icon/Tango/22/places/folder.png)
> #asset(qx/icon/Tango/22/mimetypes/office-document.png)
> 
> #asset(qx/icon/Tango/32/places/folder-open.png)
> #asset(qx/icon/Tango/32/places/folder.png)
> #asset(qx/icon/Tango/32/mimetypes/office-document.png)
> 
> #asset(qx/icon/Tango/16/apps/office-calendar.png)
> #asset(qx/icon/Tango/16/apps/utilities-color-chooser.png)
> #asset(qx/icon/Tango/16/actions/view-refresh.png)
> 
> #asset(qx/icon/Tango/16/actions/dialog-cancel.png)
> #asset(qx/icon/Tango/16/actions/dialog-ok.png)

If you want to just replace the qooxdoo images used by framework code
(decorations, icons, ...) you need their original resource id's. That
is, if your combined image's meta file contains a key
"test2/Modern/form/button-b.png" (these keys are taken as resource
id's!), it will never be picked up in places where the resource id
"qx/decoration/Modern/form/button-b.png" is required. If you insist on
copying images around, you have to copy them to your source/resource
folder with the exact resource path they had in their original location
(starting with "qx/...").


> - run generate.py build , it creates the build with the combine image
> but without the individual files from the modern theme.

Currently, you cannot avoid the individual files being copied. But you
can avoid them being used.

> 
> But the app is still looking for the individual images!

The problem is that the images in your combined images will never be
considered. And how could they?! Their "names" (i.e. resource id's) are
e.g. "test2/Modern/form/button-b.png", but there is not a single line of
JS code that refers to this name. They are all looking for
"qx/decoration/Modern/form/button-b.png"!

Here is what I recommend:

- Don't copy the images, just reference them in your images.json. Just
make sure you specify the correct prefix for them (ending in
"...framework/source/resource").

- Run the combined job, check the combined image (by looking at it) that
it contains the images you wanted, and check the .meta file to see that
the keys are really the resource id's of framework images.

- In your own code (e.g. theme), specify your *combined images* in
#asset hints, e.g.:

  #asset(myapp/test/Modern/form-combined.png)

This is necessary so they get copied over with the build version.

- As I said you cannot prevent the individual images being copied during
the build job. But you could e.g. delete them after the build step. Your
app should run with just the combined images.

HTH. Get back if you have further issues.

T.

----------------------------------------------------------------------------
--
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel



------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to