Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #596897

    Hi!

    Is it possible to change the image size in the AJAX-Portfolio?

    Cheers!
    Michiel

    • This topic was modified 8 years, 9 months ago by Michiel.
    #597320

    Hi Michiel,

    Could you provide us with a link to the site in question so that we can take a closer look please? How would you like to change the images? Please try to explain a bit further and/or post screenshots of what you are looking to achieve.

    Thanks,
    Rikard

    #597367

    Hi Rikard,

    Yes, of course. ;)

    Link: http://www.perswinkel.nl/producten-in-de-pers/

    I’m using the AJAX-portfolio as this seems to be the only way I can make sure a visitor can click through all entries for 1 category. If I use the Lightbox, the visitor will still click through all items, regardless of what filter they clicked. As you can seen in the screenshot, my client mostly uses portrait images, while the image size that’s used for the AJAX-portfolio is landscape. I’d like to change that.

    AJAX-portfolio

    And: would it be possible to change the generated image sizes or add a custom generated image size for portret images?

    #598545

    Can i join the conversation? I’m interested as well :)

    #600383

    Hi!

    Thank you for coming back.

    As far as I see you are using the Avia Layout Builder and a Portfolio Grid 3 colums.

    When editing the grid (in the popup) you have a selectbox “Portfolio Grid Image Size”.
    Select “Choose the Portfolio Grid image size manually (select thumbnail size)” opens a selectbox below with all available sizes.

    If you need additional image sizes you can add/modify them using the following filter found in \enfold\functions.php line 129:

    
    $avia_config['imgSize'] = apply_filters('avf_modify_thumb_size', $avia_config['imgSize']);
    

    If you have problems using a filter give us a feedback and we provide you with the code.

    Hope, this solves your problem.

    Regards,
    Günter

    #600461

    Hi Günter,

    Thanks for your help!

    This is what the settings look like:
    Settings portfolio

    The portfolio overview now uses the setting I selected, but that’s not what I meant. When clicking on an image, the AJAX-portfolio opens with it’s own image size. Is it possible to change that image size? See the first screenshot in this thread.

    The issue of adding my own image size is solved by installing the Simple Image Sizes plugin.

    #603556

    Hi!

    I checked the site but the AJAX portfolio is disabled. Please enable it back. The default thumbnail size is set to “gallery”. If you need to use the original image, add this in the functions.php file:

    add_action( 'avf_portfolio_preview_template_params', 'avf_portfolio_preview_template_params_mod', 10, 2 );
    function avf_portfolio_preview_template_params_mod($params, $entry) {
    	if($params['method'] == 'slideshow') {
    		 $params['preview_size'] = 'no scaling';
    	}
    
        if($params['method'] == 'gallery') {
    		 $params['preview_size'] = 'no scaling';
    	}
    	return $params;
    }

    Cheers!
    Ismael

    #612118

    Hi Ismael,

    I’d like to jump on this as well.

    I’ve been reading forums for a couple of hours now – but nothing’s really answers the questions.

    More and more I am getting clients that don’t even know how to resize an image – which is totally frustrating.
    I have setup a new website and everything has been size and uploaded at the correct size for each element.
    it’s perfect!

    However once the client steps in – I just know that original iPad or iPhone images are going to be uploaded to the WordPress Gallery.
    These original full size images will range from 2 MB to 5MB.

    To remedy this I have installed SMUSH PRO.
    ( however with smush pro activated – I keep getting HTML Errors when uploading to the Image Library)

    I also am aware that Enfold Resizes the images to the theme thumbnail sizes. However..

    ISSUE 1.
    The original uploaded full size image still remains on the server.
    example:
    File size: 3 MB
    Dimensions: 3264 × 2448

    I’d like to make one of the enfold theme images (or a custom image size) as the new full size image and delete the original full size image from the upload directory.
    The hope is that when your in WordPress Media Library and you select an image – the attachment details window is some thing more like this.
    Example:
    File size: 134KB
    Dimensions: 845×684 (Which is the Enfold thumbnail size for Gallery – 845×684)

    I’m looking into the link below as a solution but wanted to know if there is something else a plugin or some previous supplied forum code that already does this.?
    http://wordpress.stackexchange.com/questions/63707/automatically-replace-original-uploaded-image-with-large-image-size

    ISSUE 2

    When you attach an image as a Feature Image or to an Ajax Portfolio Gallery – the ability to select the attachment size is not available.

    As discussed when setting up the site and creating a Ajax Portfolio and the Post Feature Images I have cropped and resized the images for their specific tasks.

    So before handing off to the client I have done a test and upload 2 original iPhone photos
    IMAGE 1
    File size: 3 MB
    Dimensions: 3264 × 2448
    IMAGE 2
    File size: 2 MB
    Dimensions: 3264 × 2448

    When I add these images to the Ajax Portfolio and then inspect the gallery element in Google Chrome Dev tools – The Gallery Large preview image above the smaller thumbnail images are 1030 x 773 which is a proportionate scaling of the original image dimensions to Enfold Thumbnail size Large – 1030 x 687.

    The thing is when I setup the site – I resized and uploaded all image for the Ajax Portfolio gallery to be (Gallery – 845 x 648)

    So moving forward the client is not going to know how to crop resize and upload the correct image dimensions

    I hoping that you can provide an example using the code above that does the reverse … and actually predefines which enfold thumbnail size (example: Gallery – 845×684) is to be the default image size for all Ajax Portfolio Gallery Images
    OR (example: entry with sidebar – 845 x 321) is to be the default image size of all Feature Images
    regardless of the original image dimensions and actually use the Enfold thumbnail sized images.

    That way the client can’t mess-up the site moving forward.

    I look forward to your response

    #613581

    Hey!

    1.) Add this in the functions.php file to remove the original image on upload:

    add_filter( 'wp_generate_attachment_metadata', 'avf_delete_fullsize_image' );
    function avf_delete_fullsize_image( $metadata )
    {
        $upload_dir = wp_upload_dir();
        $full_image_path = trailingslashit( $upload_dir['basedir'] ) . $metadata['file'];
        $deleted = unlink( $full_image_path );
    
        return $metadata;
    }

    2.) The thumbnail size settings is not available when setting a featured image because you have to set it in the portfolio grid’s Portfolio Grid Image Size option.

    NOTE: If you choose the first option in Portfolio Grid Image Size settings, the portfolio grid will follow this logic:

    case "1": $grid = 'av_fullwidth';  if($preview_mode == 'auto') $image_size = 'featured'; break;
    				case "2": $grid = 'av_one_half';   break;
    				case "3": $grid = 'av_one_third';  break;
    				case "4": $grid = 'av_one_fourth'; if($preview_mode == 'auto') $image_size = 'portfolio_small'; break;
    				case "5": $grid = 'av_one_fifth';  if($preview_mode == 'auto') $image_size = 'portfolio_small'; break;
    				case "6": $grid = 'av_one_sixth';  if($preview_mode == 'auto') $image_size = 'portfolio_small'; break;

    Regards,
    Ismael

    #614432

    Hi Ismael,

    1.) Thanks for the code. I see that this deletes the original image. But it does not assign another image as the thumbnail image for the word press Media Library. ?

    2.) thanks I think I understand. However I was actually wanting to set the image size on the AJAX PORTFOLIO GALLERY. However After resizing the window I see that the AJAX PORTFOLIO GALLERY is RESPONSIVE and there for source image for the gallery large image changed to the appropriate image source as the browser window resized.
    So this one is ALL GOOD!
    Thanks ; )

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘AJAX-Portfolio change image size’ is closed to new replies.