Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [image]

Denotes questions about image processing, importing, upload and management.

32
votes
4answers
31k views

Get original image file from a cache URL

Is there any function that given a cache image product file return the original one? Example : => Cache URL: {BASEURL}/media/catalog/product/cache/2/image/9df78eab33525d08d6e5fb8d27136e95/a/l/IMAGE....
20
votes
13answers
26k views

Getting full image URL of product in template

I'm trying to create a static block for showing dynamic products. This is code that is supposed to get every child category and print the image for each product in each category. <?php $...
15
votes
2answers
15k views

Regenerate catalog cache images issues

I'm doing migration process from Magento 1.9.2.4 to Magento 2.1.6, after migration completed, I move media folder of M1 to pub/media M2. Now the problem is some of the images doesn't generate in ...
12
votes
2answers
6k views

Adding an image form element to an add/edit form

I'm building a CRUD module for Magento 2 using ui components for admin list and form and one of my entities has an image field. But I cannot make it work as it should. Here is how it should work. When ...
10
votes
2answers
5k views

Magento 2 Get image Url in controller or helper?

How to get the image in the controller or helper. For example, the path of images folder: /app/code/Nitesh/Module/view/frontend/web/images /app/code/Nitesh/Module/view/frontend/web/images/image.png
10
votes
1answer
6k views

How to get child product image in Magento Cart

I am trying to get the child product image of a configurable product that was added to cart by the customer. For example, if the customer added a pair of red shoes to the cart I would like to show ...
9
votes
5answers
15k views

Magento 2: How to get resize image for Custom Module?

I'm using Magento 2 CE Version 2.1.0 I have Custom Module with Image Field. When it's uploaded, i want different size images as for product we have Thumbnail Image, List Image & Product Detail ...
9
votes
8answers
21k views

Magento image upload not working even after giving all folders 777 permissions

I am unable to upload images in magento admin panel , getting error "Destination folder is not writable or doen't exist". Recently moved all files from one hosting to another. Any solution for this?
9
votes
4answers
35k views

Adding images with CSV import

I have been running into problem after problem with the CSV export/import functions. My currently problem is that I cannot seem to assign 'image', 'small_image', and 'thumbnail' attributes to any ...
9
votes
3answers
21k views

Magento 2 - Getting product Image url in Model/block not in template file? [duplicate]

I am sending product data as response for the rest api call, I want to get product Image Url, currently using this: $imagehelper = $objectManager->create('Magento\Catalog\Helper\Image'); $image = ...
8
votes
7answers
18k 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
2answers
10k views

How to retrieve the Category name, Category URL and Category image using Category-Id?

As we know that in the Category Management page we can upload an image and give a URL for each category. I want to retrieve the Category name, Category URL and Category image using only the Category ...
8
votes
1answer
5k views

Insert image at the side of payment label on checkout

How could I insert an image at the side of the payment method on checkout. In example, at the side of credit cards payment method I want to display the Visa and Master Cards logo.
8
votes
3answers
48k views

How many different ways to insert image in magento cms page?

i tried to insert image with two different ways like through CMS pages in that select page and in content use below code: <p><img src="{{skin url='images/media/404_callout1.jpg'}}" alt="" /&...
8
votes
1answer
7k views

How to upload multiple image in admin panel grid form?

Here, I would like to upload multiple image in admin panel grid form in magento. I create images upload in admin panel grid form. Here I attached my image upload coding. [....] $fieldset->...
8
votes
3answers
4k views

Mini-Cart displaying Parent Product Image instead of Product Image

I've got code that will display a product in the mini-cart using ajax, when a customer clicks on Add to Cart. The issue is that it is not displaying the child product image until I do a refresh of ...
8
votes
1answer
131 views

how to optimize load all categories with image

right now, I have two nested foreach to loop through all the category, and it's extremely slow (3-4s on my local server). I think the problem is i use ->LOAD() to get the image path for the child ...
8
votes
1answer
185 views

Mage_Catalog_Model_Product_Image::_checkMemory

Looking at slow requests in newrelic for a product listing page the top function called was Mage_Catalog_Model_Product_Image::_checkMemory() which does a bunch of stuff like checking the ini settings ...
7
votes
3answers
8k 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 ...
7
votes
1answer
11k views

How to path for background image in less file in magento 2? [closed]

I want to set path for background image in less file app\design\frontend\vendor\theme\web\<lessfile> in magento2.
7
votes
2answers
11k views

Find the attribute_id by attribute_code

I need to find the attribute_id values of the attributes image, small_image and thumbnail. I know them for my database - 85, 86 and 87, but I need to make my query dynamic, instead of with hard-coded ...
7
votes
1answer
5k views

Curious about 'Exclude' option on product image tap

Manage Product - Product Detail - Images Tap There are Base Image / Small Image / Thumbnail / Exclude / Remove I found most of my image have checked on 'Exclude' I tried to uncheck or ...
7
votes
2answers
2k 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
1answer
1k views

Product loop giving incorrect images

I am looping through products and getting an error with product images. The code I am working with is below: <?php $collection = Mage::getModel('catalog/product')->getCollection(); ...
7
votes
3answers
16k views

Show product discount percent in Magento

I would like to show discount percentage on image as badge (refer image 2). I followed the instructions from http://www.customy.com/blog/show-product-discount-percent-in-magento/ and managed to show ...
7
votes
2answers
5k views

Magento 2 placeholder image only showing in thumbnail

I have the same placeholder image uploaded for all four options: base, small, swatch, and thumbnail. The placeholder is showing fine for the thumbnail on the category page, but when I click on one to ...
7
votes
4answers
8k views

How to fix: “HEADER ALREADY SENT” and GD2?

This is a follow on to the question on How to debug: HEADER ALREADY SENT and GD2. Specifically how to fix the following errors (note first line had been added using previous debug advice to track the ...
7
votes
2answers
3k views

Customer address attribute value is not saving in Magento 2

We are working on trying to create customer address attribute as input type is File, we have downloaded the code from silksoftware by selecting "Need to Add Customer Attribute" -> "Entity Type" -> "...
6
votes
1answer
7k views

Magento2 images in CMS block [duplicate]

I have an image in: /var/www/html/app/design/frontend/Alothemes/milano/web/images/natale/IMG_7300.JPG How can I refer to this image in CMS block? I know I should use: <img src="{{media url="..."}...
6
votes
2answers
33k views

How can I get magento product image url for a thumbnail in an array?

I have a data module that gets information for a product and its attributes associated with it like color, sizes etc. In here there is an image that needs to be taken and put into an array in ...
6
votes
2answers
8k views

Programmatically Update Image Labels

I'm trying to update my product images' labels. I want them to be the same as the name of the product. What I've tried $mediaModel = Mage::getModel("catalog/product_attribute_backend_media"); $...
6
votes
4answers
9k views

Add an image attribute in Magento product admin

This feels like it should be really simple - but I can't seem to find the answer. I would like to add an attribute in magento where the user can upload an image. I do not want this to appear as a ...
6
votes
3answers
6k views

Wysiwyg custom attribute with cms directives is not working

I have a wysiwyg custom attribute. Insert an image there: But in the html code source I see this one: <img src="{{media url="wysiwyg/article1.jpg"}}" alt="" /> Instead of <img src="...
6
votes
1answer
1k views

Resizing any image in Magento

Magento has this great helper to resize product images but I'd like to resize any image from PHTML template files. Now I could use the Varien_Image (lib/Varien/Image) class but it doesn't implement ...
6
votes
1answer
3k views

Add Images in Magento Theme template file

I want to add image like footer.png in app/design/frontend/vendorname/themename/Magento_Theme/templates/html/footer.phtml Here I am adding image using <img src='<?php echo $this->...
6
votes
3answers
14k views

Product Image Cache - Image Resizing

My question is about how and when images get created inside the product image cache. Specifically, if this code is executed: $imageTag ='<br><img src="'.Mage::helper('catalog/image')->...
6
votes
1answer
3k views

Add an image product attribute in Magento 2 in module setup

I've been trying to find an article/question related to the creation of an 'image' type attribute for a product in Magento 2. That is: having just a browse field where the user can upload an image (...
6
votes
1answer
704 views

Magento - Auto set base, small and thumbnail on upload

Morning, We have literally searched all over Stackoverflow and Google to find this solutions but still don't have the right answer. We're trying to auto-set the Base, Small and Thumbnail options on ...
6
votes
1answer
1k views

How does gallery attribute work

I don't understand what the gallery attribute does? I've imported products and images. The images were imported into an attribute called gallery but they don't show up in the admin or on the front-end....
6
votes
1answer
526 views

Magento 2: insert products images alt tag programmatically

I need to insert ATL tag for catalog products images programmatically. Is there any way to do it?
6
votes
1answer
718 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 ...
5
votes
2answers
12k views

Magento 2: Get image url

I used <?php echo $this->getViewFileUrl('Vendor_Module::images/demo.jpg'); ?> <?php echo $block->getViewFileUrl('Vendor_Module::images/demo.jpg'); ?> But it's working only ...
5
votes
5answers
16k views

Magento 1.9.2.1 - Images in frontend and backend not showing

I've been on this issue since 1.9.2.1 was released. In 1.9.1 everything worked like a charm. When upgrading to 1.9.2.1, all images in the frontend and backend can't be loaded for some reason. Even if ...
5
votes
2answers
23k views

How to get a products small image in the side cart?

I used this code to display a Thumbnail image : <?php echo $this->getProductThumbnail()->resize(50, 50)?> but i would like to display the small image. I used that to my sidebar cart
5
votes
6answers
13k views

Images not showing in admin Product Information page for some admin users

I have a situation where two admin users can go into a Product Information page and see the product images in the Images tab - when rolling over the image - but two other users can't see them. For ...
5
votes
3answers
3k views

How to debug: “HEADER ALREADY SENT” and GD2?

I have an annoying HEADER ALREADY SENT error in system.log. It is not easy to debug it, what I could do was to improve the logging to isolate the source of the issue (has described here): Cannot ...
5
votes
2answers
1k views

Image attribute in Product Flat Catalog

I have a Magento 1.8 CE and I figured out that when using "Product Flat Catalog", the attribute "image" is not collected. How can i add that attribute to "Product Flat Catalog" It is not possible to ...
5
votes
2answers
2k views

Bulk replacing with compressed images?

I have a catalogue of over 10,000 products, and would like to replace the images for the products with compressed versions, is there an extension that will allow me to do this, or an easy way besides ...
5
votes
2answers
4k views

Magento 2 add extra image Type/Role

How can we add extra field in image role in product page admin panel. I want to add new field same as thumbnail in Image role popup. http://awesomescreenshot.com/0e467tlo04
5
votes
6answers
19k views

Product images are not uploaded in magento admin

In magento admin while adding products image is not uploading.I tried by uploading in different browsers but it too doesn't worked.I have given 777 file permissions to media folder.When i upload image,...