Uploading non-image files to templates that use the resize robot.

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

{ "steps": {
    "thumbnail": {
      "robot": "/image/resize",
      "resize_strategy": "crop",
      "width": 150,
      "height": 150,
      "format": "png"
    },
    "store": {
      "use": [":original", "thumbnail"],
      "robot": "/s3/store",
      "key": "xxx",
      "secret": "xxx",
      "bucket": "xxx"
    }
} }

I’m looking to use just one template for all uploads and to derive the file-type from your response. I’m not sure what the alternative would be other than trying to detect the file-type by extension in js and then directing uploads to different templates depending on the type. Ideally, images would get thumbs generated and everything else would simply skip that step. When uploading a non-image to this template I get a “result” field for :original for some files and not for others. My assemblies log shows that a “result” is being created for :original for all files however its not always being returned to me.

Is this crazy?

Hey Graham,

our robots are smart folks. They ignore all files by default that they can’t handle. The image/resize robot for example will ignore all files that are not images.

You should always get a :original result field for all files for this templates. This is not the case?