Jump to content

Image not resizing when added programatically


jitheshkt

Recommended Posts

Hi,

 

I am abel to add image programatically. But images are not getting resized. In other words resized images are not generating. Attaching the code I use :

$image = new Image();
        $id_image = Product::getCover($id_product);
        $shops = Shop::getShops(true, null, true);
        $image->id_product = $id_product;
        $image->position = Image::getHighestPosition($id_product) + 1;
        $image->cover = true; // or false;
        if (($image->validateFields(false, true)) === true &&
            ($image->validateFieldsLang(false, true)) === true && $image->add())
        {
            $image->associateTo($shops);
            if (!AdminImportControllerExtended::copyImgCustom($id_product, $image->id, $image_url, 'products', false))
            {
                $image->delete();
            }
        }

Any one know what I am missing ?

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...