• Resolved streamworksaudio

    (@streamworksaudio)


    Is it possible to prevent uploaded images from the front end from being cropped? When a vendor uploads the image the banner is cropped and resized to the recommend size (625×300). However some will like to upload double that size for retina displays, but the image is still cropped and resized.

    Is there some way to stop this cropping from happening?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Shafinoid

    (@shafinahmad01)

    Hi @streamworksaudio

    I believe you are doing well.

    To disable Image cropping you can increase the Banner size to 5000. With that higher image size, the image won’t be cropped with the usual sized image.

    Here’s the file path to perform the modifications
    wp-content/plugins/dokan-lite/includes/Assets.php

    See this screenshot which will provide more clarity.

    Best Regards!

    Thread Starter streamworksaudio

    (@streamworksaudio)

    Thank you!

    I just had a look at that file on the github repo and it is not the same as the screenshot. For example, on the screenshot it is line 622, while on the github file it is line 655 – is this a change that will be deployed in a future release?

    Also, are you recommending changing the value of these variables in this file? If so this would break on the next update?

    Perhaps, as a suggestion, this variable could have a filter applied to it? This would allow developers that want to apply a custom value to the banner width/height do so via a filter.

    Cheers

    Thread Starter streamworksaudio

    (@streamworksaudio)

    Just had a look at the commits for the Assets.php file and it looks like the dev team was reading my mind ??

    https://ibb.co/BTksZ7N

    Shafinoid

    (@shafinahmad01)

    Hi @streamworksaudio

    It’s a new hook added to the codebase. Within the newer update, you can modify the size via the hook directly to the fuinction.php file of your child theme.

    You can modify the file or wait for the newer update and modify the child theme’s function.php.

    Best Regards!

    Thread Starter streamworksaudio

    (@streamworksaudio)

    Thanks again.

    That is what I thought. I think I will wait for the next update, there is no rush ??

    Cheers!

    Shafinoid

    (@shafinahmad01)

    Hi @streamworksaudio

    I’m glad to hear that. The newer update is released and I believe you will be able to customize and achieve your requirement.

    I may resolve this topic if you have no further queries and feel free to create a new one, we will be here to assist you.

    Best Regards!

    • This reply was modified 3 years, 4 months ago by Shafinoid.
    Thread Starter streamworksaudio

    (@streamworksaudio)

    Thanks again!

    I did see the update last night and confirm that it was in the change log (also a few other fixes I was looking for). Updated it this morning and will get to working tweaking the filter for a custom size.

    Keep up the good work guys!

    Cheers

    Thread Starter streamworksaudio

    (@streamworksaudio)

    Just thought I confirm that this filter does the trick and to mark the thread resolved.

    Cheers

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Prevent cropping on uploaded images’ is closed to new replies.