0

Is it possible to use the flow logic or file filtering in Transloadit to convert a PNG to a JPG if the uploaded file is not already a JPG, but skip the step and continue with the other processing steps otherwise?

From what I can see from the docs, you can only halt an assembly if a condition is or isnt met..

Thanks!

schmoove
  • 493
  • 1
  • 4
  • 16

1 Answers1

1

You can use the /file/filter robot to pass :original files only to an /image/resize step if it matches your conditions.

You should disable error_on_decline to make this filtering seamless.

Here's more information on the /file/filter robot and here are all the variables you can use to filter by.

Looks like you could use either ${file.ext} or maybe ${file.mime}

Hope this helps!

kvz
  • 5,517
  • 1
  • 42
  • 33