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.

Adding images to entries (an easy way)

December 30, 2009 9:07am

Subscribe [13]
  • #16 / Mar 18, 2010 3:21pm

    hothousegraphix

    851 posts

    Curious to know if anyone has come up with a way to re-size “large” images on upload?

    We’ve used a number of process and currently implement one similar the process Mr. Frost describes but the one item this process lacks is the scaling down of large images.

    Mark Huot’s (outdated and unsupported) File extension did do this in it’s later iterations but I think at this point to be using that extension opens anyone implementing it up to support issues.

    nGen’s File fieldtype is a super nice and simple with some added UI benefits like Thumb/previews and the ability to browse a directory for already uploaded files.

    I totally appreciate all of the issues associated with attempting to take on development of this process. Is the extension/module a file browser; a file manager; an image optimizer; etc, etc? I think this is why we, as users of EE, end up piecing together different addon’s to accomplish our goals.

    I don’t really think that there will ever be one addon that answers everyone’s wishes. Anyway…enough of this rant!

    Would anyone have a suggestion for a way to set in the File Upload preferences the image max-height and max-width and rather than throwing an error when the image is too large, run it thru a resizing process so that the image is scaled down to within the max settings?

  • #17 / Mar 18, 2010 7:30pm

    James Smith

    259 posts

    Add Copee Pastee extension to this method for a further workflow improvement:

    http://ellislab.com/forums/viewthread/126430/

  • #18 / Jun 04, 2010 12:20pm

    pixelmom

    4 posts

    Thanks Paul, this was a lifesaver for me.

    I’ve got one problem, though, in the display of the captions. Short captions show up fine, but longer ones (and this client uses a lot of long captions) shift of to the side.

    This is the code I’m using:

    <!-- Code to place images -->
    {exp:lg_replace:haystack needles="{cf_images backspace="1"}image_{row_count}|{/cf_images}"}
    <!-- Now loop through the matrix and create the individual links -->
    {cf_images}
    {exp:lg_replace:replacement needle="image_{row_count}"}
    <div class="{align}"><a href="http://{image}">{exp:imgsizer:size src="{image}" auto="{size}" title="{caption}" alt="{caption}" class="{align} img"}</a>
    {caption}
    </div>
    {/exp:lg_replace:replacement}
    {/cf_images}
    <!-- End of loop -->

    Attached images show what I’m getting.

  • #19 / Jun 04, 2010 12:40pm

    James Smith

    259 posts

    pixelmom, more of a CSS issue that one… you’ll need to make sure your wrapper div is floated, but NOT the image inside it - remove the {align} class from the imgsizer tag.

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

ExpressionEngine News!

#eecms, #events, #releases