Job Options

Jobs can have additional parameters associated with them that perform specialized operations.

Common Options

  • postback_url(string) - This indicates the URL that Blitline will call back once the job has completed. (Think of it as the webhook that gets called when this job completes).
  • postback_headers(dictionary) - These are headers that Blitline will add to the postback when the postback_url is called.
  • get_exif - Returns the full exif data from the “src” file.
  • wait_retry_delay(int) - If Blitline is unable to download the “src” image, this value indicates how long (in seconds) Blitline will wait before retrying. If this value is missing, Blitline will not retry downloading and, fail immediately.
  • pre_process(dictionary) - Defines actions to take before processing this job. Scope is too big to discuss here, please read more here

Specialized Options

  • src_type(string) - Blitline can handle different sources besides images. It can screenshot a website for example. This identifies how to treat the “src” node. The options are as follows:
    • screen_shot_url - The “src” is a URL identifying a webpage to take a screenshot of.
    • burst_pdf - The “src” is a PDF and you wish to break out each of the pages into a separate job.
    • smart_image - Makes Blitline "guess" best options for whatever filetype you are rendering. This is a recommend setting for best results from Blitline
  • src_data- There may be additional metadata needed in the processing of the “src”. This node allows for extra data to be identified along with the “src”.
    • (For Images) colorspace(string) - Sets the colorspace of the image upon loading. Options are “rgb” or “cmyk”.
    • (For Images) preserve_alpha(bool) - If set to true will force PDF and TIFF images to preserve alpha channels. Otherwise they are deleted by default.
    • (For Screenshots) viewport(string) - Set the “viewport” (virtual browser size) for screenshot. Uses the format “WIDTHxHEIGHT” (e.g. “300x480”)
    • (For Screenshots) delay(int) - The delay (in seconds) after the page loads to wait before the screenshot is taken. This allows javascript that was running “onLoad” to finish rendering. By default this is 5. (Set to 0 for faster screenshots if you don’t do asynchronous javascript rendering)
    • (For PDFs) dpi(int) - Sets the density at which the PDF will be rasterized. If making a printable image, you probably want this to be 200 at least.
  • suppress_auto_orient(bool) - Blitline automatically orients the images to their proper orientation, if you wish to SUPPRESS this feature, you can do it by setting this to TRUE.
  • hash(string) - Causes the metadata about the original to return with a hash. The possible values are “md5”, “crc32”,”sha256”, “phash_dct”, or “phash_mh”.
  • include_iptc(bool) - Blitline will return all the metadata associated with the IPTC fields embedded in the image.
  • extract_colors - Extracts most common colors from image (example)
    • max_colors(int) - number of top colors to extract (default 8)

Example:

{
    "application_id":"YOUR_APP_ID",
    "v" : 1.27,
    "src":"https://s3.amazonaws.com/img.blitline/filters/boys.jpeg",
    "src_type" : "smart_image",
    "get_exif" : true,
    "src_data" : {
      "colorspace" : "srgb"
    },
    "functions":[
        {
            "name": "resize_to_fit",
            "params": {
                "width": 1000,
                "only_shrink_larger": true
            },
            "save": {
                "image_identifier": "Some ID you need",
                "extension": ".png"
            }]
        }
    ]
}

Did this page help you?