Questions tagged [product-images]
Denotes questions related to product images configuration, management and modifications.
1,264
questions
32
votes
3
answers
68k
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 ...
25
votes
7
answers
72k
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 ...
24
votes
12
answers
122k
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->...
24
votes
3
answers
16k
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->...
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 ...
19
votes
4
answers
18k
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?
18
votes
2
answers
7k
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. "...
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 - ...
14
votes
3
answers
16k
views
How can we load product image gallery instantly without the delay in magento?
this is my first question bare with me :)
Problem: The fotorama gallery used in Magento 2 makes the user experience sluggish. It does not matter how fast my cached static Magento 2 runs if the product ...
13
votes
3
answers
9k
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
12k
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/...
10
votes
3
answers
52k
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 ?
9
votes
4
answers
39k
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.
9
votes
3
answers
14k
views
Getting a custom attribute image
Magento 2 question here:
I've made a custom attribute (media type) with the name of 'bike_range_image', and tried googling and searching in the core and everything I could to get the image with a ...
9
votes
2
answers
2k
views
Hide small images on frontend Magento 2
I have Magento 2 and want to hide small images of the product that is added from the admin on frontend. I have hidden the small image attribute from admin but want to hide it from front-end as well.
9
votes
2
answers
29k
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/...
9
votes
4
answers
4k
views
Magento 2 is there a faster way to change product media gallery entries programmatically
I need to do a massive update of product data but what I need to do can't be achieved with product import. In example I need to update media gallery and categories for given products, but the solution ...
8
votes
8
answers
36k
views
Magento 2 Get all product images in on product list page
In Magento 1 I've always used
$_product->getMediaGallery('images')
But in the source from Magento 2 I see
$productImage = $block->getImage($_product, $image);
echo $productImage->toHtml();
...
8
votes
7
answers
22k
views
how to get all images of a particular product
How to get all images of a particular product by using this code i am able to fetch only single image of the particular product..
Please help i am new to this.
<?php
// Get products in category
...
8
votes
7
answers
19k
views
How to change div fotorama__stage height on product view page
How can I change height in the below code on Product detail page
<div class="fotorama__stage" data-fotorama-stage="fotorama__stage" style="width: 462px; height: 372px;">
I have tried below ...
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 ...
8
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 ...
8
votes
5
answers
20k
views
Magento2 : get image path of product
I created custom page for getting products . I got all information but how to get full image path. I am using getImage() it is showing image only how to get full path.
<a href="<?php ...
8
votes
2
answers
648
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 ...
7
votes
9
answers
33k
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 ...
7
votes
3
answers
21k
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,
"...
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($...
7
votes
2
answers
3k
views
Get product baseimage without product object
How can i get the product base-image without loading the whole product object ? I have product-id,sku.[I know we can get product base image from product object]
Is there any best method or trick ...
7
votes
2
answers
2k
views
SQL error when programmatically adding image to product
I am updating products programmatically and then adding images to them via
$product->addImageToMediaGallery($file, array( < flags > ), true, false);
For some products, this works just fine, for ...
7
votes
1
answer
4k
views
Show different thumbnail image set for each color picked in configurable product
Hi everybody (first post here), I've been trying Magento 1.9 display a different set of thumbnail images for every option in the color swatch, in a configurable product, but with no success.
For ...
7
votes
1
answer
1k
views
Watermark Category Images with Brand Logo
I'd like to add a watermark to each small image (but only in the category listing page) that is based on the manufacturer attribute. I don't want to alter the small image for that product on other ...
7
votes
3
answers
3k
views
Product image not zooming in properly when hovering on image at product detail page
In my product page detail when i try to hover the product image there's only white box with low opacity overlaying at the top of my image like this :
Usually in Magento 2, when hovering the image it ...
6
votes
6
answers
16k
views
The image cannot be removed as it has been assigned to the other image role?
I am using Magento 2.1.4 unable to remove the image while removing it noticing "The image cannot be removed as it has been assigned to the other image role".
How can I overcome this?
I have ...
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, ...
6
votes
2
answers
4k
views
Magento2 : Manage and understand images of deleted products behavior?
I'm trying to understand how M2 handle images of deleted products. If I delete a product (by admin or import/delete), all associated images in the media/catalog/product folder are still here.
In M1 ...
6
votes
2
answers
689
views
Excluding product images progamatically
How do you exclude all product images of a product, i.e. the Exclude box of every image being ticked on the Images tab in the Magento backend.
I'm bulk adding new images to products using $product-&...
6
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%...
6
votes
2
answers
2k
views
Uploaded images not appearing on frontend and backend with a Broken image symbol
I have uploaded images to products. It has been viewed then in backend and frontend it is not appearing.
I have checked with stackoverflow answers like
Products do not show up in front end
and ...
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 ...
6
votes
2
answers
1k
views
Product collection by non-existing images
I want to create a collection of all the products without a image and set them do the status "disabled".
Because i use a automatic import script there are some products that HAD images before, but ...
6
votes
4
answers
5k
views
Get Magento second image in product view page
I want to display image 2 from a product in the product view page next to the description. I need some help putting this code together.
I found some code online, but it gives me image 1 (base image). ...
6
votes
2
answers
4k
views
Control placeholder image width/height in magento 2
I can control the product images width/height in view.xml located in app/design/<vendor>/<theme>/etc in product list page. Some of the products not having images so it tries to show ...
6
votes
1
answer
2k
views
How to solve CRITICAL error of getimagesize() after data migration in Magento2.2.0?
After data migration process in Magento2.2.0,
When I open category page at frontend than I get this type of error in system.log file,
[2018-01-02 11:56:58] main.CRITICAL: Warning: getimagesize(/...
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 ...
6
votes
1
answer
5k
views
Magento 2 replace product images via CSV import
I'm following this tutorial http://docs.magento.com/m2/ce/user_guide/system/data-import-product-images.html to upload and assign images to product.
I have successfully completed this process but i ...
6
votes
2
answers
2k
views
How can I remove the white borders from images? Magento 2.1
All my images appear like this.
<image id="category_page_grid" type="small_image">
<width>240</width>
<height>300</height>
</image>
<image id="...
6
votes
0
answers
2k
views
How do I add Product Images as URL instead of uploading them in Magento?
I am making a fashion store in Magento. I have affiliation with many stores and I don't want to save their product images on my server because of space issue, they require a lots of space more than 30 ...
5
votes
7
answers
24k
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
7
answers
19k
views
Can't see product images in admin, also missing Browse Files and Upload Files
I can see all product images at the store level, but can NOT see any images in the admin area! Furthermore when I create a new product under admin, the "Browse Files..." and "Upload Files..." buttons ...
5
votes
6
answers
26k
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 ...