Multiple automatic image resizing and cropping

Hi everyone.
I'd like to make a plugin that will create different versions of images when they're uploaded.
For example:
If I upload an image that is 1920x1200, the plugin would automatically save a 1680x1050 version, a 1280x720 version, etc.
I'm going to try to learn how to make plugins but I haven't made one for zenphoto before so I could really use any help possible.
Thanks in advance.

Comments

  • Actually I've done it myself by modifying the viewer_size_image plugin. Thanks for that Stephen.
  • Oh by the way Stephen, the cookie time format is wrong so it only lasts for the session. To fix it, change line 128 from:
    `document.cookie='viewer_size_image_saved='+$(obj).attr('value')+'; expires=<?php echo date('Y-m-d H:i:s', time()+COOKIE_PESISTENCE); ?>; path=<?php echo $cookiepath ?>';`
    To:
    `document.cookie='viewer_size_image_saved='+$(obj).attr('value')+'; expires=<?php echo date('D, j M Y H:i:s', time()+36000000); ?> UTC; path=<?php echo $cookiepath ?>';`
  • `COOKIE_PESISTENCE` should be normally be `5184000`. Maybe you have changed that define?
  • Oh I just chose to edit that but that wasn't the problem, the problem was the date format.
    It should be `D, j M Y H:i:s` instead of `Y-m-d H:i:s` :)
Sign In or Register to comment.