×
Please submit new Bug Reports on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues
Images Thumbs
Javier Mata Salazar
New Member
Posts: 5
pred 8 rokmi 6 mesiacmi #1305
od Javier Mata Salazar
Images Thumbs bolo vytvorené Javier Mata Salazar
Hi, i use CC to create a component for a catalog, i need put some images for each product, but i need create thumbs for the images, i try use createThumbs for the library JIMAGE but i cant do it work,
i have a group of images fields -> field -> images and this make me a field with a array with images, for example:
{"image_1":"images\/menu-urbanas.jpg","image_2":"","image_3":"","image_4":"","image_5":""}
i need, when i save the form create a thumbs for each image, and this thumbs need have a name like md5($item->id) . "_XS." . $extension
have too a field with another image, in both case need, the image original, and a thumbail for a size that i declare in the config of the component, with this sped dont have problems, my problem is creating que thumbs
i create a gists to show the code about i do it, and i explain better in SPANISH :-S
gist.github.com/javimata/bbe59be6cbdb2791d6a40954f51ffef9
i have a group of images fields -> field -> images and this make me a field with a array with images, for example:
{"image_1":"images\/menu-urbanas.jpg","image_2":"","image_3":"","image_4":"","image_5":""}
i need, when i save the form create a thumbs for each image, and this thumbs need have a name like md5($item->id) . "_XS." . $extension
have too a field with another image, in both case need, the image original, and a thumbail for a size that i declare in the config of the component, with this sped dont have problems, my problem is creating que thumbs
i create a gists to show the code about i do it, and i explain better in SPANISH :-S
gist.github.com/javimata/bbe59be6cbdb2791d6a40954f51ffef9
Prosím Prihlásiť alebo Registrácia pre zdieľanie konverzácie.
Troy Hall
New Member
Posts: 5
pred 8 rokmi 5 mesiacmi #1320
od Troy Hall
Odpoveď od Troy Hall na tému Images Thumbs
watching
Prosím Prihlásiť alebo Registrácia pre zdieľanie konverzácie.
Walt Sorensen
New Member
Posts: 5
pred 8 rokmi 5 mesiacmi #1332
od Walt Sorensen
Odpoveď od Walt Sorensen na tému Images Thumbs
A quick glance at your gist, I don't think you are using createThumbs() correctly.
I suggest looking at the API for the function createThumbs() api.joomla.org/cms-3/classes/JImage.html#method_createThumbs
It doesn't give you an option to specify a file name, just a folder.
I suggest also looking at generateThumbs() api.joomla.org/cms-3/classes/JImage.html#method_generateThumbs
Which I think might be better suited to your application. You could create you thumbs manipulate the image object to rename the thumbs, then use toFile to write the image to disk in the renamed format. api.joomla.org/cms-3/classes/JImage.html#method_toFile
I suggest looking at the API for the function createThumbs() api.joomla.org/cms-3/classes/JImage.html#method_createThumbs
It doesn't give you an option to specify a file name, just a folder.
I suggest also looking at generateThumbs() api.joomla.org/cms-3/classes/JImage.html#method_generateThumbs
Which I think might be better suited to your application. You could create you thumbs manipulate the image object to rename the thumbs, then use toFile to write the image to disk in the renamed format. api.joomla.org/cms-3/classes/JImage.html#method_toFile
Prosím Prihlásiť alebo Registrácia pre zdieľanie konverzácie.
Javier Mata Salazar
New Member
Posts: 5
pred 8 rokmi 5 mesiacmi #1334
od Javier Mata Salazar
Odpoveď od Javier Mata Salazar na tému Images Thumbs
thanks, i create a git with my solution, maybe is not the better but work for my, the info is in spanish :-S
i hope this help to someone
github.com/javimata/thumbnails-en-componentes
i hope this help to someone
github.com/javimata/thumbnails-en-componentes
Prosím Prihlásiť alebo Registrácia pre zdieľanie konverzácie.
Čas vytvorenia stránky: 0.054 sekúnd