Questions tagged [product-images]

Denotes questions related to product images configuration, management and modifications.

Filter by
Sorted by
Tagged with
17 votes
13 answers
59k views

Magento 1.9 - No upload image buttons

I am building my first Magento store, but I found out that I can't add images to products. It is testing site, so I am learning how things are functioning in Magento. I tried almost everything - ...
  • 171
3 votes
2 answers
7k views

Magento 2: Save all product data outside Magento with Images

I have below code with Image Upload which is working fine. But images are not stored in Database Table as mentioned in Order. include('app/bootstrap.php'); use Magento\Framework\App\Bootstrap; $...
  • 9,721
32 votes
3 answers
67k views

How can I change the default product images sizes on Magento 2?

In magento 1.x.x, we could change default thumbnail images in admin : System > Configuration > Catalog But in magento 2.0, how can I change theses value I can not seem to find any configs to allow ...
  • 632
24 votes
3 answers
54k views

Change product image for configurable products

I was looking for a way that let me change the product image based on the attribute selected for the configurable product. e.g. Configurable Product With Color Options : 1) Red 2) Green If the Red ...
  • 1,515
24 votes
3 answers
15k views

Faster way to load media images in a product collection

TL;DR: How do I load the product images/gallery without loading the whole product? I want to load the images on a product. What I do in the .phtml $_popularCollection = $this->...
  • 980
18 votes
4 answers
17k views

How to increase the quality of product photos JPG (Magento 2)

The JPG compression on Magento 2 is very strong, so that the quality of product images get really bad in Catalog and Product view. How can I change the Image compression for JPG's in Magento 2?
23 votes
12 answers
112k views

How to get product image and URL in Magento 2?

This is my observer: public function execute(\Magento\Framework\Event\Observer $observer) { $orderIds = $observer->getEvent()->getOrderIds(); $order = $this->...
9 votes
3 answers
46k views

What does catalog:images:resize do in magento 2?

I am having a problem with how my images are displaying on my Magento 2 store. And also I would like to know: What does catalog:images:resize in Magento 2.x version ?
  • 418
8 votes
2 answers
640 views

Unable to see the actual images in the back end

Magento 1.9.1 Porto theme We had to have our hosting company do a full restore. Now most things work except for when going into the images tab in the Admin panel: it shows the BROWSE FILES and ...
  • 256
7 votes
7 answers
15k views

Delete Unused Catalog Product Images

I have taken over a magento store that over 3 years has built up a large amount of product images that are no longer in use but were never deleted. Is there a way i can delete all images that are no ...
  • 1,376
6 votes
4 answers
3k views

Undefined index "media_type" while adding image to product's media gallery

Here is the code snippet I use to add an image in a product's media gallery : $sku = 'product-example-sku'; $image_url = 'http://example.com/image.jpg'; $image_ext = pathinfo($image_url, ...
4 votes
2 answers
5k views

Configurable product image not switching with swatch change

I am trying to get configurable swatches working in a custom theme in a 1.9 build. I am basically using this method of importing the functionality in the theme. The swatches are working fine, they are ...
  • 4,203
3 votes
3 answers
5k views

How to Change Product Images with external Image url in all magento 2 frontend and Backend Image display?

I want to change Product Images to external Image URL in Magento 2 Frontend. Product Listing Page. Product Details Page Gallery. Related Products. Upsell Products listing. Cross Sell Listing. All ...
2 votes
3 answers
3k views

Magento 2 - GIF Images , Animation is not working on frontend

I am trying to upload .gif image for few products , image is uploading from admin panel successfully and animation also working in admin panel. But issue here is when i am checking this product on ...
  • 9,720
2 votes
2 answers
4k views

Magento 2 and Animated GIFs as Product Images

Is there a way in Magento 2 to allow for animated gifs as product images? I can upload them to the backend without any issues, but when I view a product on the front-end it just shows them as ...
1 vote
1 answer
9k views

How to resize image of product view page in Magento 2?

I want to resize product view gallery image. I want to resize main product image to 500X500 size? How can we achieve this?
  • 729
1 vote
1 answer
610 views

What is the use of Magento 2.2.6 product image cache?

I have some points regarding the Product Image Cache to discuss with you. I have created a product from the Magento admin panel. After creating the product, I have uploaded two of the product ...
  • 1,124
25 votes
7 answers
66k views

Regenerate catalog cache images issues

I'm doing the migration process from Magento 1.9.2.4 to Magento 2.1.6, after migration completed, I move the media folder of M1 to pub/media M2. Now the problem is some of the images don't generate in ...
  • 9,807
13 votes
3 answers
8k views

How to delete unused images from my media folder?

I have more than 50,000 images in pub/media of products. But there are so many unused images so I want to remove all images which are not associated with any product. For Magento 1.9.x this can be a ...
13 votes
3 answers
11k views

Magento 2 Rest Api get Thumbnail Image url

How do we get the url to thumbnail image of of a product through rest API. /V1/products/{sku}/media would get us the relative url such as "/m/b/mb01-blue-0.jpg" and the image url would be baseurl/...
8 votes
5 answers
22k views

Magento Delete all Product Images

I have a magento Installation which has had several image imports done by the client and its got wrong images in the wrong products, toasters with fridge freezers as the initial import had the wrong ...
7 votes
9 answers
31k views

Magento 2 can not upload product images

Any time I try to add images to a product in Magento 2.1 I get the following error: Attention: We don't recognize or support this file extension type. It does not matter what type of image I ...
6 votes
2 answers
17k views

Magento : Product Images and browse and Upload button Missing

I have no solutions found since last one week. In My magento 1.9.3.1 all product images and browse file button and upload files button are missing on product edit in admin show in screen-sort. kindly ...
  • 69
5 votes
6 answers
23k views

Magento2: How to remove product images programmatically?

During edit product from front-end I need to remove images of the product gallery which are checked by the user to remove it.
5 votes
5 answers
8k views

magento 2 Uncaught TypeError: Argument 2 passed to Magento\Catalog\Block\Product\ImageFactory::getLabel() must be of the type string

In custom theme And category page show this error- Fatal error: Uncaught TypeError: Argument 2 passed to Magento\Catalog\Block\Product\ImageFactory::getLabel() must be of the type string, null given, ...
  • 1,185
4 votes
2 answers
9k views

Default uploading image size in Magento 2

I met one strange issue in Magento 2 - I’m trying to change default uploading image size from 800x1200 to 934x1400. I modified view.xml and now uploaded images going straight to folder media/catalog/...
4 votes
3 answers
7k views

magento 2 Default image file types not acceptable

I have an issue where I cannot add images to products on Magento 2.0.7. Attempts to do so with jpg, png, jpeg, and/or gif yield the following error: Attention We don't recognize or support this file ...
  • 121
3 votes
0 answers
547 views

When I deselect the swatch once after selected, the product image is not displaying in magento 2

When I deselect the swatch once after selected the product image went blank when I inspected and the image src went undefined in Magento 2.2??
3 votes
5 answers
13k views

SSL Error - Invalid or self-signed certificate for non https configuration

After many hours of googling and experimenting I have no ideas what else could be wrong. When I try to upload product images I get: SSL Error: Invalid or self-signed certificate. It's only visible ...
2 votes
7 answers
9k views

MIME type not valid when uploading image using REST API

I'm trying to set a product image using the web api by POSTing to this url: http://my_magento_server/rest/V1/products/my-url-key/media With the following content: {"entry": { "media_type": "...
  • 227
2 votes
1 answer
2k views

Magento 2.2.4 : Add custom checkbox in product image details in admin

I added the custom checkbox in product image details page. But, when I check it's not selected and not saved after saving records. I want to do like as Hide from Product Page checkbox working.
1 vote
4 answers
1k views

Decrease the download size of an product image

you can use inspect element to see product image source and download the images . the sizes of image are more than 400 kb. I want to reduce the size of the image. media.phtml =http://pastebin.com/...
1 vote
2 answers
460 views

Base image is blank

i hope someone can help me. Base image is not showing when I choose the product, but small and thumbnail works fine.This happened after I imported products again but with the Default attribute (I ...
1 vote
1 answer
2k views

Images are not loading after upgrade to Magento 2.3.0

We have upgraded magento from 2.2.8 to 2.3.0 Upgrade is done correctly, But product images are not loading in list page and product detail page. Right now the product images are taking like below ...
  • 1,819
0 votes
1 answer
989 views

How can I get the "exclude" product images in magento?

I want to display the "exclude" product images in a section on my product page. How can I do this?
0 votes
1 answer
777 views

With multi-store how do I ensure only one set of cache images are created?

In a multi-store Magento build each store view will have a corresponding cache folder in /media/catalog/product/cache, e.g. '1' for store '1'. In the website I am currently working on we have an ever-...
  • 2,025
0 votes
0 answers
346 views

Images not uploading

I tried to upload images for product but its not uploading and getting an like unable to list current working directory
  • 179
0 votes
1 answer
2k views

Set product image size? [duplicate]

I got this method in my RelatedProduct class that gets related product image URL public function getProductImageUrl($product) { return $this->_storeManager->getStore() ->...
  • 753
0 votes
0 answers
49 views

Why Products Image Divided when i hover the images?

When i try to hover the products images its getting divided, how can i solve this error,
  • 145
0 votes
1 answer
140 views

How to get all product images in modal slider?

<div class="pdp-media"> <a class="product-image" href="<?php echo $item->getProductUrl(); ?>"> <img src="<?php echo $this->helper('catalog/image')->init($...
18 votes
2 answers
6k views

Magento 2: best practice to add/delete product Images programmatically?

I want to upload images to the existing products. The images are in import_dir. And they need to be added to the product that already exists in the catalog. I could find only 2 ways how to do it. 1. "...
  • 321
9 votes
4 answers
38k views

How to import product images in bulk into Magento 2?

I'm moving my store from ver 1.7.2 to 2.0.2. Since I have less than 200 products I will export/import them using CSV files, however I'd like to know how to import product images.
  • 1,599
9 votes
2 answers
27k views

how to get product thumbnail and product url in order confirmation email

I have tried already mentioned solution for getting product thumbnail image along with product url (link to product)using below solution /vendor/magento/module-sales/view/frontend/templates/order/...
7 votes
3 answers
20k views

How to add product image when creating via rest api?

This is how I creating product. { "product": { "attribute_set_id": 4, "type_id": "simple", "sku": "B201-SKU", "name": "B201", "price": 25, "status": 1, "...
user avatar
7 votes
1 answer
6k views

how to add an image programmatically from any url in Magento 2?

I try this code but if the image doesn't exist in this path pub/media/catalog/product; it doesn't work. I want to add an image from any url; any ideas for that ? for ($i = 0; $i < count($...
  • 71
6 votes
1 answer
4k views

Magento 2 > Images Background Color do not apply

On Magento 2.0.2 I edited my custom theme view.xml (app/design/frontend/XXXXX/default/etc/view.xml) and added 2 properties for each images type : transparency and background. My file now looks like ...
  • 632
5 votes
6 answers
25k views

Magento 2 product images not showing, 2 different directories

Magento2 is looking directly in the root folder for media and static files. It is not looking in pub/media folder. Product images are not showing in the front. I installed Magento 2 in a subdirectory ...
  • 51
5 votes
1 answer
6k views

Get multiple product images using REST API

I'm requesting products list using the following API call GET /V1/products http://127.0.0.1/magento2github/index.php/rest/default/V1/products?searchCriteria%5BpageSize%5D=100000&searchCriteria%...
  • 284
5 votes
2 answers
10k views

Product Image does not load on product page

I am having an issue with products images in Magento 2. The products were brought in from a Magento 1.7 install using the data migration tool. I then copied the media/catalog folder from the M1 ...
  • 3,222
5 votes
3 answers
928 views

Magento 2 - Get product image url in API

I am creating custom API in magento 2 and I need to get image URL of product. I have used this code to get image URL: $imageUrl = $this->listProductBlock->getImage($product,"category_page_grid"...
  • 9,113