magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Suggestion: Category Image resize

Open tzyganu opened this issue 12 years ago • 11 comments

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.

tzyganu avatar Sep 02 '14 07:09 tzyganu

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

waynetheisinger avatar Sep 02 '14 08:09 waynetheisinger

@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?

tzyganu avatar Sep 02 '14 10:09 tzyganu

+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" [email protected] 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.

barbazul avatar Sep 02 '14 13:09 barbazul

@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?

tzyganu avatar Sep 02 '14 13:09 tzyganu

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" [email protected] 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.

barbazul avatar Sep 03 '14 13:09 barbazul

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

verklov avatar Sep 04 '14 13:09 verklov

Internal ticket: MAGETWO-28058

vpelipenko avatar Jan 29 '15 12:01 vpelipenko

Thank you for your submission.

We recently made some changes to the way we process GitHub submissions to more quickly identify and respond to core code issues.

Feature Requests and Improvements should now be submitted to the new Magento 2 Feature Requests and Improvements forum (see details here).

We are closing this GitHub ticket and have moved your request to the new forum.

piotrekkaminski avatar Aug 30 '16 20:08 piotrekkaminski

I needed exactly that for a project. Also noticed that it would be very convenient to easily resize images on our custom and third party modules depending on the Project design. For that reason, we created a module to resize images just calling a method. You can check it out here: https://github.com/staempfli/magento2-module-image-resizer

jalogut avatar Oct 13 '16 20:10 jalogut

Thank you @jalogut for your extension. Is working very well.

PieterCappelle avatar Jan 18 '17 10:01 PieterCappelle

@PieterCappelle you're welcome. Happy to help. I am glad that people use it :)

jalogut avatar Jan 20 '17 16:01 jalogut