Common functions

Functions and attributes for Upload

You can upload files from the following storage types:

  • Local
  • Web

Upload from local

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.

Upload from local

Upload from web

Uploading from the Web works in the same way as uploading from local but using a public URL.

Upload from web

File attributes

You can set rotation attribute:

File attributes

Rotate a file

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);

Delete files

You may need to delete previously uploaded files from a task. In this case, you can use the following delete function:

Delete files

Advanced processing

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:

Advanced processing

Ignore file errors

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.

Try to repair a damaged image

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:

Try to repair a damaged PDF

Set output filename

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:

  • {filename} = original filename
  • {n} = file number
  • {date} = current date
  • {tool} = current processing action

So the final output name could be:

Set output filename

Set a package filename

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:

  • {filename} = original filename
  • {date} = current date
  • {tool} = current processing action

So the final output name could be:

Set package filename

Functions for download

Download functions are exactly the same as the basic upload functions and allow you to download your output files.

Functions for download

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.