You can upload files from the following storage types:
For local files,you must assign them to the created Task tool and it is necessary always set a local path filename in order to upload it.
Uploading from the Web works in the same way as uploading from local but using a public URL.
You can set rotation attribute:
It's possible to rotate the orientation of any uploaded file by using the rotate property with one of four direction parameters (Up = 0, Right = 90, Down = 180, Left = 270);
You may need to delete previously uploaded files from a task. In this case, you can use the following delete function:
We have now seen how to process an image files in a very basic way. Now we will go through more processing instructions which have more advanced and common options to consider. You will see that each tool has its own advanced processing customization options, but here we will focus on those common to all the tools.
Example code:
Some of the uploaded files may be damaged and therefore cannot be processed. ignore_errors allows you to ignore those damaged files and force the task to process only the good ones.
Tasks have ignore_errors set to true by default so you won’t need this function unless you want to force an error message for any damaged file.
One of the newest iLoveIMG features is the possibility to repair damaged image files. By default the API tries to repair any damaged file but this feature can be disabled with:
As a rule, the output filename of files will be the same as the input filename in most cases. However, it depends on the tool used. You can also customize the output filename with output_filename.
This function works with simple strings made up of the following predefined vars:
So the final output name could be:
iLoveAPI will always pack multiple output files in a single compressed file. You can set this package filename with packaged_filename and the following predefined vars:
Download functions are exactly the same as the basic upload functions and allow you to download your output files.
Now that you know all the common advanced features for Upload, Process and Download instructions, you are ready to dive into the functioning of the iLoveAPI Tools.