PDA

View Full Version : Src.sencha.io usage



jop_008
23 Apr 2012, 3:17 AM
Hi,

I try to scale my images in a carousel with the src.sencha.io option

I use this html: '<p><img src="http://src.sencha.io/http://localhost:8080/webapp_ios/mvillacomfort/resources/imgs/terras avondsfeer.jpg"></p>',
this results in a 404 error message. The path of the image is fine.
Is there a way to use relative paths with src.sencha.io?

John

SebasSP
23 Apr 2012, 3:49 AM
The Sencha IO Src server needs to retreive your image in order to be able to resize it. Since your image is on your localhost it will not be able to get it. Try accessing the image from your public ip (with the right port forwarding) or put it on a live server.

jop_008
23 Apr 2012, 5:34 AM
Thanks I am gonna change this. I guess relative paths are not possible.

John

jop_008
23 Apr 2012, 9:14 AM
Hi,

I changed the code to this:

html: '<p><img src="http://src.sencha.io/http://jophosting.x10.mx/mvillacomfort/resources/imgs/terras avondsfeer.jpg"></p>',
},{
html: '<p><img src="http://src.sencha.io/http://jophosting.x10.mx/mvillacomfort/resources/imgs/trapmuurtje.jpg"></p>',

but this was without success no pictures in the carousel.

John

edspencer
23 Apr 2012, 1:18 PM
Those urls work for me when I open them inside the browser - try this instead:



Ext.create('Ext.Carousel', {
items: [
{
xtype: 'img',
url: 'http://src.sencha.io/http://jophosting.x10.mx/mvillacomfort/resources/imgs/terras avondsfeer.jpg'
},
{
xtype: 'img',
url: 'http://src.sencha.io/http://jophosting.x10.mx/mvillacomfort/resources/imgs/trapmuurtje.jpg'
}
]
});

jop_008
24 Apr 2012, 10:12 AM
Hi,

Thanks for your feedback.
My code has to run form a tabpanel so one of the items of Ext.tab.panel is this

{
title: 'Foto\'s',
iconCls: 'bookmarks',
xtype: 'carouselLB'
}

and 'carouselLB' is this

Ext.define( 'Myapp.view.Carousel', {
extend: 'Ext.Carousel',
xtype:'carouselLB',
items: [
{
xtype: 'img',
url: 'http://src.sencha.io/http://jophosting.x10.mx/mvillacomfort/resources/imgs/terras avondsfeer.jpg'
},
{
xtype: 'img',
url: 'http://src.sencha.io/http://jophosting.x10.mx/mvillacomfort/resources/imgs/trapmuurtje.jpg'
}
]
});

Now I have a blank page without error messages. You can see the site here:
http://jophosting.x10.mx/mvillacomfort/

John

jop_008
26 Apr 2012, 10:17 AM
Hi,

I got this information from a friend

resizing images to fit page is not a trivial task.
The simplest way is calculate width and height in proportion of image container.
Is this using flex or set height and width.
I tought sencha.io was the rescue.

But the high level - is css transformation and translation (with
calculated parameters).

Thanks for help
John