Jump to content

Release: Thumbnails


apeisa

Recommended Posts

Thanks for the quick answer! I wasn't sure about support, but well, with all the great additions around images lately, it's probably hard to keep up with that. Is horst's CroppableImage module the recommended way to get this running now? And what to do about legacy websites?

Link to comment
Share on other sites

Hi,

I'm using this function to resize my pictures for responsive images

<?php 

function respImg($img,$description="",$class="") {

  $mini   = 200;
  $small  = 400;    
  $medium = 640;
  $large  = 960;
  $xlarge = 1280;
  $xxlarge = 2400;

  $out = "<img 
    src='{$img->width($mini)->url}' 
    data-sizes='auto'
    data-srcset='
            {$img->width($mini)->url} {$mini}w, 
            {$img->width($small)->url} {$small}w, 
            {$img->width($medium)->url} {$medium}w,
            {$img->width($large)->url} {$large}w, 
            {$img->width($xlarge)->url} {$xlarge}w'
            {$img->width($xxlarge)->url} {$xxlarge}w'
    alt='{$description}'
    class = '{$class} lazyload' /> ";
  
  return $out;
  
};?>
When I try to commit a cropped image I get following error:

Fatal error: Call to a member function width() on a non-object in D:\xxxxxx\site\templates\_functions.php on line 80

Is it possible to crop the via module cropped images again in order to deliver responsive images? What would you do?

Many greets, Jens.

Link to comment
Share on other sites

Maybe it is possible for you to switch to croppableImages as it returns pageimages that you can resize further. The original CropImage does return a URL, not a pageimage object.

  • Like 1
Link to comment
Share on other sites

Maybe it is possible for you to switch to croppableImages as it returns pageimages that you can resize further. The original CropImage does return a URL, not a pageimage object.

Hey horst,

thank you for this hint! Exactly, what I've searched for!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...