Last active
April 19, 2016 00:58
-
-
Save DocumentAlchemy/4f842c0f115834470a5abdb908cd9967 to your computer and use it in GitHub Desktop.
An example of using curl and the DocumentAlchemy API to resize an image.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example of using curl and the DocumentAlchemy API to render a | |
# scale an image to fixed width while preserving the orignal | |
# aspect ratio. | |
# This particular example will work with PNG and JPEG files, | |
# and convert any input JPEG documents to PNG. | |
# See <https://documentalchemy.com/> for more information about | |
# DocumentAlchemy's document conversion and processing capabilities. | |
# Assuming: | |
# | |
# - `403l1zh3dkbakyb9` is the value of your Document Alchemy API key, | |
# - `IMAGE.PNG` is the image you want to resize | |
# - `IMAGE-240.PNG` is the file you want to save the resized image to. | |
# | |
# the following command will upload the image to DocumentAlchemy | |
# and download the transformed image: | |
curl -H "Authorization: da.key=403l1zh3dkbakyb9" \ | |
-X POST --form "[email protected]" \ | |
https://documentalchemy.com/api/v1/document/-/rendition/png/transform/S240,0 \ | |
-o "IMAGE-240.PNG" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment