Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1270671

    Hello,
    I would like the images I import to the site to stay in their original ratio. However, currently they are automatically recized and cropped. For example, when I import images to the blog, they are cropped to format 495x400px, and therefore they appear blurry.. :(

    Could you help please ?
    I’ll appreciate it

    Thank you,
    Audrey

    #1270759

    Hi Audrey,

    Try adding this code in your child theme’s functions.php file:

    add_filter( 'avf_modify_thumb_size', 'enfold_customization_modify_thumb_size', 10, 1 );
    function enfold_customization_modify_thumb_size( $size ) {
    	$size['portfolio'] = array('width'=>990, 'height'=>800', 'crop' => false);
    	return $size;
    }

    Then try to re-upload the image/s if there are lots of them then use Regenerate Thumbnails plugin.

    Best regards,
    Nikko

    #1270810

    Hi,

    Your code causes a critical error on the site. Could you check it ?
    Thanks,

    Audrey

    #1270905

    Hi Audrey,

    I apologize for that, the error was caused by the extra ‘ after 800, this is the fixed code:

    add_filter( 'avf_modify_thumb_size', 'enfold_customization_modify_thumb_size', 10, 1 );
    function enfold_customization_modify_thumb_size( $size ) {
    	$size['portfolio'] = array('width' => 990, 'height' => 800, 'crop' => false);
    	return $size;
    }

    Best regards,
    Nikko

    #1270935

    Hi Nikko,
    It’s the same.. the code causes a critical error :(

    Thank’s in advance
    Audrey

    #1270973

    Hi Audrey,

    I have tested the code and it does not cause any errors on my end.
    Can you give us FTP access? we’ll try to add it for you.

    Best regards,
    Nikko

    #1271018

    Hi Nikko,

    Please excuse me, I tried again and the code does work ! Is it possible to prevent cropping of the image inside the article? This one is cropped at 800x321px. I would like to leave the original size of the photo 800×600.

    Thank you very much for your help
    Audrey

    #1271136

    Hi Audrey,

    We’re glad that it worked :)
    Please replace the last code I gave with this one:

    add_filter( 'avf_modify_thumb_size', 'enfold_customization_modify_thumb_size', 10, 1 );
    function enfold_customization_modify_thumb_size( $size ) {
    	$size['portfolio'] = array('width' => 990, 'height' => 800, 'crop' => false);
    	$size['entry_with_sidebar'] = array('width' => 800, 'height' => 600, 'crop' => false);
    	return $size;
    }

    Then re-upload the images or regenerate them.

    Best regards,
    Nikko

    #1271151

    Thank you very much Nikko ! It’s perfect
    Have a good day

    Best regards
    Audrey

    #1271307

    Hi Audrey,

    Great, I’m glad that Nikko could help you out. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

    #1271364

    Hi Rikard,
    Yes you can close it, thank you very much

    Have a good day
    Best regards,
    Audrey

    #1271410

    Hi,

    If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘How to prevent images from being resized’ is closed to new replies.