Login | Forgot password | Register

X

What is OpenID?

OpenID is an Internet-wide identity system that allows you to sign in to many websites with a single account.

With OpenID, your ID becomes a URL (e.g. http://username.myopenid.com/). You can get a free OpenID for example from myopenid.com.

For more information visit the official OpenID site.

Jump to:

17480 Posts in 4474 Topics by 1973 members

Archive

SilverStripe Forums » Archive » Image resizing using GD

Our old forums are still available as a read-only archive.

Page: 1
Go to End
Author Topic: Image resizing using GD 1027 Views
  • Decisive Flow
    avatar
    Community Member
    71 posts

    Image resizing using GD Link to this post

    I followed the tutpirial on this page: http://doc.silverstripe.com/doku.php?id=imageupload&s=image

    Using silverstripe 2.2

    Here is my (non working) code (located on ArtistPage.php):

       
       class ArtistPage_ResizedImage extends Image {
       function generateArtistResized($gd) {
        $gd->setQuality(100);
       return $gd-> paddedResize(340,340);
       }
       }

    Here is the code on ArtistPage.ss:

    <img src="$Resized.ArtistResized.URL" alt="$Title"/>

    It appears to be exaclty the same as what they told me to do, but it doesn't work!

    The image I've uploaded is called PrimaryImage in ArtistPage.php if that has anything to do with it.

    Any help?

  • Blackdog
    avatar
    Community Member
    138 posts

    Re: Image resizing using GD Link to this post

    any reason you aren't using the inbuilt resizing image controls?

  • adiwidjaja
    avatar
    Community Member
    10 posts

    Re: Image resizing using GD Link to this post

    Yes, does this

    <% control PrimaryImage %>
    <% control ResizedImage(340,340) %>
    <img src="$URL" alt="My resized Image" width="340px" height"340px" />
    <% end_control %>
    <% end_control %>

    not work (following http://doc.silverstripe.com/doku.php?id=imageupload&s=image, at the end)?

    Cheers,

    Andy

    1027 Views
Page: 1
Go to Top

Currently Online: _Vince

Welcome to our latest member: AlfonsoGrondo

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.