View Full Version : Where and how to store images?

27 Feb 2012, 12:19 PM
Pardon if I'm missing the obvious but I'm trying to add a custom image label to my app. By default when I add the img control it is populated with Sencha logo and is referenced as "resources/images/sencha.png". There's no "resources" directory in the project source tree so I'm assuming that this file is loaded remotely. Does that mean that I have to have a running webserver and specify my image source using "http://foo.com/resources/images/foo.png"? Is there a way to add a static image files to the project ans have these published as part of the deploy?

27 Feb 2012, 12:25 PM
You can create/add any additional files into the projects working directory that you would like.

These will be included along with your deployment. You can reference these files relative to your urlPrefix/where you are developing/deploying.

27 Feb 2012, 1:03 PM
Are you referring to the directory containing .metadata folder? If so - I manually created resources/images dir there and added foo.png. No image is shown in Designer which is not surprising to me since I think it is looking at some remote location. And when I do deploy the resource folder is not copied to my destination

27 Feb 2012, 1:06 PM
Yes, your project directory.

All additional files/folders here will copied to your deploy directory.

Is your project directory in a webroot and does it match your urlPrefix in your settings?

27 Feb 2012, 2:03 PM
OK - it does copy everything. Including .metadata and .svn folders (which I don't want is there any way to prevent this?). My project directory is not under my webserver. I'm using Tomcat so I deploy files under unwrapped WAR directory.
I get it to the point where after deploy I can see my image file on the webserver but that doesn't help me to build my UI in Designer since I can't get my image to display there

So I have:
Ext JS Path: http://extjs.cachefly.net/ext-4.0.2a/
Sencha.io Library path: http://extjs.cachefly.net/designer/IO/
URL Prefix: http://localhost:8080/foo/
Deploy path: C:/dev/workspaces/td/ui/foo/src/main/webapp

27 Feb 2012, 2:15 PM
The file will have to be servable by your urlPrefix and the relative path during design time if you wish to see it.

We are working on some fixes regarding .metadata, .svn, etc

27 Feb 2012, 2:22 PM
The only way I can get it working is to provide absolute network location e.g. http://localhost:8080/foo/resources/images/foo.png. If I set my urlPrefix to http://localhost:8080/foo and relative path to resources/images/foo.png I see nothing. And again, where does sencha.png is coming from?

27 Feb 2012, 2:31 PM
I just tested this and its currently broken/not working as it should.

The sencha.png is an internal resource.

6 Mar 2012, 12:22 PM
I just tested this and its currently broken/not working as it should.
The sencha.png is an internal resource.

Is this issue fixed?

6 Mar 2012, 12:47 PM
No. It will still work in deployed version but will not show up in design mode.

6 Mar 2012, 1:01 PM

22 Jul 2012, 12:03 PM
When will this be fixed? Makes working with images very tedious.

24 Jul 2012, 4:35 PM
When will this be fixed? Makes working with images very tedious.

This has been fixed for a few months. Just tested and verified that it was working in Build 442 on OS X and Windows.

Did the following to verify.

Created a new touch project
Saved the touch project in a web accessible directory (~/Sites/)
Named the project img
Put an image.png into the ~/Sites/img/ directory
Drag out an Image component and set the src to image.png

Changed my url prefix setting to http://localhost/img/

Architect then knows where to load the image from.

2 Dec 2012, 10:02 AM
i am using image for display but it doesn't work