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.

Outputting manipulated images from file fields

May 04, 2012 12:32pm

Subscribe [3]
  • #1 / May 04, 2012 12:32pm

    Frank Harrison

    154 posts

    Hi

    A few times in the forums, I’ve seen people ask how to output the manipulated version of image uploads to file fields. (In a channel:entries tag, not in file:entries tag). The popular solution seems to be:

    {main_image}
    {path}_small/{filename}.{extension}
    {/main_image}

    That works ok as long as a file has been uploaded. But if that field is left empty, I get errors like this:

    A PHP Error was encountered
    Severity: Warning
    Message: array_merge() [function.array-merge]: Argument #1 is not an array
    Filename: libraries/Functions.php
    Line Number: 2585

    Admittedly only super admins see these, but I’d rather no-one did!

    Is there an ETA on a simpler way to output manipulated images? Seems like image manipulations have been part of EE for some time now but still aren’t fully working… Or might there be a fix for these errors?

    Thanks loads, Frank

  • #2 / May 04, 2012 5:34pm

    Boyink!

    5011 posts

    “It’s in there!” (showing my age with that commerical reference, but what the hey..😉

    http://ellislab.com/expressionengine/user-guide/modules/channel/custom_fields.html#file-field

  • #3 / May 05, 2012 7:43am

    Frank Harrison

    154 posts

    Ah - that’s great news! (Although I didn’t get your commercial reference without googling it…)

    Looks like Matrix doesn’t support it yet, but this has fixed the issues I was having.

    Thanks!

  • #4 / May 07, 2012 10:48am

    Shane Eckert

    7174 posts

    Hello Frank,

    I am really glad to see that Mike was able to help you out here.

    Thank you for the assist Mike!

    If you need anything else, please just let us know by opening a new thread.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases