Jump to content

Generating thumbnails for one product image.


kobylecki

Recommended Posts

Hej,

I'm writing import module from specific system to PrestaShop. I copied image file in right place (img/p/)

and named `id_product`-`id_image`.jpg.

And now I need to know how to generate all thumbnails (-small, -large, -medium, -home, ...).

 

I found method which regenerates all thumbnails, but I want to generate thumbnails only for that new image.

 

Where I need to search for such a method?

Edited by kobylecki (see edit history)
Link to comment
Share on other sites

I already found a solution:

$images_types = ImageType::getImagesTypes();
foreach ($images_types as $image_type)
   ImageManager::resize($path.'.jpg', $path.'-'.stripslashes($image_type['name']).'.jpg', $image_type['width'], $image_type['height']);

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...