• With this plugin you will have hundreds of images repeated in different sizes.

    I like if can program for use large size in desktop and small or medium in mobile tablet. And one option for slideshow will be great.

    How is now you create many images in the server.

    in tiled-gallery.php delete:

    if ( $image_src[1] > $width || $image_src[2] > $height ) {
    
    		// the file is larger, check if the resized version already exists (for crop = true but will also work for crop = false if the sizes match)
    		if ( file_exists( $cropped_img_path ) ) {
    
    			$cropped_img_url = str_replace( basename( $image_src[0] ), basename( $cropped_img_path ), $image_src[0] );
    			
    			$vt_image = array (
    				'url' => $cropped_img_url,
    				'width' => $width,
    				'height' => $height
    			);
    			
    			return $vt_image;
    		}
    
    		// crop = false
    		if ( $crop == false ) {
    		
    			// calculate the size proportionaly
    			$proportional_size = wp_constrain_dimensions( $image_src[1], $image_src[2], $width, $height );
    			$resized_img_path = $no_ext_path.'-'.$proportional_size[0].'x'.$proportional_size[1].$extension;			
    
    			// checking if the file already exists
    			if ( file_exists( $resized_img_path ) ) {
    			
    				$resized_img_url = str_replace( basename( $image_src[0] ), basename( $resized_img_path ), $image_src[0] );
    
    				$vt_image = array (
    					'url' => $resized_img_url,
    					'width' => $new_img_size[0],
    					'height' => $new_img_size[1]
    				);
    				
    				return $vt_image;
    			}
    		}
    
    		// no cached files - let's finally resize it
    		$tp_image = wp_get_image_editor( $file_path );  
     		if ( ! is_wp_error( $tp_image ) ) {
    			$tp_image->resize( $width, $height, $crop );
    			$new_img_array = $tp_image->save();
    		}
    		$new_img_size = getimagesize( $new_img_array['path'] );
    		$new_img = str_replace( basename( $image_src[0] ), basename(  $new_img_array['path'] ), $image_src[0] );
    		
     
    
    		
    		
    
    		// resized output
    		$vt_image = array (
    			'url' => $new_img,
    			'width' => $new_img_size[0],
    			'height' => $new_img_size[1]
    		);
    		
    		return $vt_image;
    	}
  • The topic ‘Suggestion for no create many images’ is closed to new replies.