Help with /file/filter

Started by Tender_user_10439005 replies17 views
Tender_user_1043900Original post
#1

Archived from the Transloadit support forum. Originally posted on January 31, 2012; details may be outdated, see our docs for current behavior. Original thread

Hi there

We’re trying to add a simple filtering step that will reject images below a certain size as they are uploaded. I’ve put the following template together, but it accepts all the images I send into it, despite being below the threshold. Help.

{ "steps": {
    "sizefilter": {
      "robot": "/file/filter",
      "error_on_decline": true,
      "declines": [
        ["${file.width}","<","800"],
        ["${file.height}","<","800"]
      ]
    },
    
    "store": {
      "robot": "/s3/store",
      "key": "REDACTED",
      "secret": "REDACTED",
      "bucket": "media.actlocalmedia.com"
    }
} }

My test image is 229x229 yet the assembly executes successfully and stores the file to s3. What am I doing wrong?

Thanks

tim-kos
#2

Hey there,

please use ${file.meta.width} and ${file.meta.height}.

Kind regards
Tim

Tender_user_1043900
#3

Thanks! You might want to add a note to the docs reminding people about using file.meta.property and not file.property – it does say that, but I missed it (obviously) for several hours last night 🙂

tim-kos
#4

Hehe, thanks for the tip, will do 🙂

Kind regards,
TIm

tim-kos
#6

Closing again