magefan / module-blog

Magento 2 Blog Extension is a solution that helps you to create a blog on Magento and manage posts,categories, tags, authors, and comments.
https://magefan.com/magento2-blog-extension
Other
263 stars 135 forks source link

Cropping Images #166

Closed GuitarKat closed 6 years ago

GuitarKat commented 6 years ago

Looking for perhaps an addition to the helper class or another solution that is out of box Magento 2.1 that can support cropping the feature image in the blog as opposed to resizing. I'm open to suggestions.

For example, a large main image (currently the feature image), then in the blog post list, a smaller thumbnail while not manually cropping the image (say like left, right or center of the image for position) and then can supply a width criteria in the function.

Thanks! Really like this module!

magefan commented 6 years ago

@GuitarKat, for now, you can only resize the post image https://github.com/magefan/module-blog/wiki/How-to-resize-post-image-in-Magefan-Blog-extension-for-Magento-2

You can extend the \ Magefan\Blog \Helper\Image class and add the cropping method.

GuitarKat commented 6 years ago

@magefan I really appreciate the quick response!

Ok, is there any cropping methods around that I can apply that can work with your image helper class? I'm not sure which ones are easy to apply or not. Any help in this direction would be helpful, or if there are any other users?

When I find a solution, I will suggest a PR from me so you guys can have the function for others. :) Or point towards where I got it from.

Thanks!

GuitarKat commented 6 years ago

@magefan I have applied a css style on a class in the .phtml file where it uses the blog list. It's not elegant and it's usecase specific and is not flexible to other image sizes/types. Thanks for hearing my suggestion for adding a cropping tool to the helper. :) Please consider this idea as a feature you may think about in your next release.

Thanks!