Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


This forum is in read only mode, you can no longer reply
  • Gísli Freyr Svavarsson 43 posts 126 karma points
    Jul 08, 2015 @ 09:42
    Gísli Freyr Svavarsson
    0

    Is there anyway to get a max size for an image.

    Fx. If I have a small image in one element and a bigger one in the next. The max width would be 500px but since the smaller image is only 250px it shouldn't stretch up to 500px but the bigger image is 1000px and should be resized down to 500px. I've tried. ?mode=max&maxwidth=500px but that resizes the small image up to 500px.

  • James Jackson-South 489 posts 1747 karma points c-trib
    Jul 08, 2015 @ 12:56
    James Jackson-South
    100

    Hi Gísli ,

    If you take a quick look at the documentation you will see that you need to turn off upscaling in combination with your image request.

    So in your case the request would be:

    http://your_image_path.jpg?width=500&upscale=false

    Resize max is a different function requiring two dimension to be set. This will resize the image to the maximum possible value in each direction while maintaining the original aspect ratio.

    Cheers

    James

  • Gísli Freyr Svavarsson 43 posts 126 karma points
    Jul 08, 2015 @ 15:52
    Gísli Freyr Svavarsson
    0

    Thanks James,

    I Thought I had read the documentation to the fullest before I posted but I guess I missed that part ;)

    cheers.

  • James Jackson-South 489 posts 1747 karma points c-trib
    Jul 08, 2015 @ 16:54
    James Jackson-South
    0

    That understandable. There's a lot to take in and they need some work.

    Glad I was able to help :)

Please Sign in or register to post replies

Write your reply to:

Draft