ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Automatically Resize Images From URL

March 25, 2009 11:54pm

Subscribe [2]
  • #1 / Mar 25, 2009 11:54pm

    kc4imr

    9 posts

    I was curious if it was possibly to put size limits on photos imported from a URL. I know it is possible if people upload the images to the site, but I like the convenience of using the Image button and URL option. Any ideas other than manually inserting “width=“400”“??

  • #2 / Mar 26, 2009 5:57am

    Mark Bowen

    12637 posts

    Hiya,

    Take a look at the Image Sizer Plugin. Should do what you are after 😉

    Hope that helps.

    Best wishes,

    Mark

  • #3 / Mar 26, 2009 11:28am

    kc4imr

    9 posts

    Mark,

    Thanks for the help! I had a feeling that might be the one. However, I am still having some trouble getting it to work. I looked through the 22 page thread and didn’t discover what it is that I was looking for. I think it is an easy fix, but I could be wrong…

    On my publish page, I have the “Image” button available, where I click it and it asks me for the URL. Many of the site users use this to bring in images from outside sites (photobucket, flickr…etc). These are the images that I want to put the limitations on. However, I think I am missing (just don’t know) the tag for that specific field…

    Below is the code I am currently using, but I feel is wrong.

    {exp:imgsizer:size src="{image}" width="200"}
    {summary}
    {exp:word_limit_plus if_exceeds="40" stop_after="40" the_link="<span align=right><a href='{title_permalink="view"}'>Read More</a></span>"}
    {body}
    {/exp:word_limit_plus}
    {/exp:imgsizer:size}

    Do I need to create a custom field? Also, I have created the cache folder in my upload section, but I am not sure if this is linked correctly.

    Any help is more than appreciated!

  • #4 / Mar 26, 2009 11:50am

    Mark Bowen

    12637 posts

    Hiya,

    I see what you are doing there but you can’t just wrap the Image Sizer tag around all your code like that.

    Are the image links that are going into your custom field being typed / pasted in and they are full urls such as http://www.example.com/image_1.jpg.

    If so then all you need to do is the following :

    {exp:weblog:entries weblog="default_site"}
    
    {exp:imgsizer:size image="{image}" width="200" alt="My Title" id="img_5334" class="entry_img"}
    {summary}
    {body}
    {/exp:weblog:entries}

    and so on and so forth.

    Hope that helps a bit.

    Best wishes,

    Mark

  • #5 / Mar 26, 2009 12:05pm

    kc4imr

    9 posts

    Hi Mark,

    Thanks again for the quick input!

    At this time, I don’t have a custom field for image. Rather, I was hoping to simply use the existing “Image” option in default Formatting Buttons, which asks for the URL.

    Is this possible or do I have to create a custom field for image? And if I do, how do I allow the image to be placed in a certain field (summary vs. body) and not just in one position?

    Thanks again!

  • #6 / Mar 26, 2009 12:12pm

    Mark Bowen

    12637 posts

    Hi Mark,

    Thanks again for the quick input!

    At this time, I don’t have a custom field for image. Rather, I was hoping to simply use the existing “Image” option in default Formatting Buttons, which asks for the URL.

    Is this possible or do I have to create a custom field for image? And if I do, how do I allow the image to be placed in a certain field (summary vs. body) and not just in one position?

    Thanks again!

    Ah right you mean that they are putting the image links into say the body field or something like that? In that case no this code won’t work I’m afraid as the plugin only accepts one image link as its URL parameter. I know that there is a plugin out there somewhere though that pulls out image tags from a body text or something like that but can’t for the life of me find it at the moment so if no-one else pops in with it then I will try and find it out later on and post back again.

    On the other hand if you could use a custom field(s) then this would become a lot easier. All depends on whether you need the images in specific places in between text or not though I suppose.

    Best wishes,

    Mark

  • #7 / Mar 26, 2009 12:17pm

    Mark Bowen

    12637 posts

    IMG Tag Modifier is one although not the one I was thinking of. I think that should do it though or at least help in the process.

    Best wishes,

    Mark

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases