cancel
Showing results for 
Search instead for 
Did you mean: 

Suggestion: Category Image resize

Suggestion: Category Image resize

Feature request from tzyganu, posted on GitHub Sep 02, 2014

I have a suggestion. Right now the image associated to the category is used in frontend as it is:

 $url = $this->_storeManager->getStore()->getBaseUrl(
            \Magento\Framework\UrlInterface::URL_TYPE_MEDIA
        ) . 'catalog/category/' . $image;

How about making it resizeable as the product images are?
Here is a use case when this might be needed:
One category has the layout 2-columns left. I have one image that fits in this format.
I take the decision to change the layout for that specific category to 3columns. I have to reupload an image in the correct size, to fit in the new layout.

But if the image was resizeable, I could just change the resize values.
The resize values can even be 2 attributes in the backend, so when I change the layout I can change the width and height as well.

If these attributes are empty then the image is shown at full size.

10 Comments
apiuser
New Member
Status changed to: Investigating
 
apiuser
New Member

Comment from waynetheisinger, posted on GitHub Sep 02, 2014

how would you see this working with responsive design and media queries?

apiuser
New Member

Comment from tzyganu, posted on GitHub Sep 02, 2014

@waynemowdirect I admit I didn't think this though, but I don't think it's relevant in this case.
If there is an issue regarding the responsive design and/or media queries, the problem is there even if the image is resized or delivered as it is. or am I missing something?

apiuser
New Member

Comment from barbazul, posted on GitHub Sep 02, 2014

+1 to resizable category images -1 to having attributes in the backend

@waynemowdirect Current responsive theme doesnt have a fix for retina images that I know of so what is your concern regarding rwd? El 02/09/2014 05:29, "waynemowdirect" notifications@github.com escribió:

how would you see this working with responsive design and media queries?

— Reply to this email directly or view it on GitHub https://github.com/magento/magento2/issues/649#issuecomment-54122561.

apiuser
New Member

Comment from tzyganu, posted on GitHub Sep 02, 2014

@barbazul Can you explain the problems you see with having the resize attributes in the the backend? Or any reason you don't like it?

apiuser
New Member

Comment from barbazul, posted on GitHub Sep 03, 2014

Yes. Site administrator and site developer/designer are very.separate roles.

Every time I see modules that give design powers to the admin a small part of my soul dies. This usually can be resolved via ACL but that is not the case for category and product attributes.

Also, your proposal of having different resize values for the different page layouts (idea that I like a lot btw) is not compatible with having hardcoded values in the admin. El 02/09/2014 10:15, "Marius" notifications@github.com escribió:

@barbazul https://github.com/barbazul Can you explain the problems you see with having the resize attributes in the the backend? Or any reason you don't like it?

— Reply to this email directly or view it on GitHub https://github.com/magento/magento2/issues/649#issuecomment-54149032.

apiuser
New Member

Comment from verklov, posted on GitHub Sep 04, 2014

@tkacheva, could you please take a look at this suggestion? Thank you!

apiuser
New Member

Comment from vpelipenko, posted on GitHub Jan 29, 2015

Internal ticket: MAGETWO-28058

mohammadbazil
Senior Member
    Spoiler
      <aspect_ratio>true</aspect_ratio>Man Tongue
Jalogut1
M2 Certified

You can check out this module. It makes possible to resize images on any block or .phtml. So it might do exactly what you need:

https://github.com/staempfli/magento2-module-image-resizer