{"_id":"564e05a15eab6e0d0069ca40","__v":1,"version":{"_id":"564de2dbfe07a81700b5c3a8","project":"564de2dbfe07a81700b5c3a5","__v":10,"createdAt":"2015-11-19T14:55:23.838Z","releaseDate":"2015-11-19T14:55:23.837Z","categories":["564de2ddfe07a81700b5c3a9","564df317826645210097a890","564df3217c8f372b00b934df","564e5227c3553e0d003e53ba","5666dac5d784a70d00397bcb","56cd08ddd98d851d00c0c3bd","56e9a50946bfd60e008840a7","5718e37bf8f7de1900683fad","58c3308dfedf070f0043b72c","58ce99c75457d02300560c0a"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"category":{"_id":"564df3217c8f372b00b934df","project":"564de2dbfe07a81700b5c3a5","__v":12,"pages":["564e01de8980c32b009e8bca","564e031f5eab6e0d0069ca38","564e057a873c362d005172b2","564e05a15eab6e0d0069ca40","564e07b01494cc2b00acb618","56941291d8c04d1700e5adc2","5696aca1cb14e11700f8aa01","56d46a4f73dcd20b00fb8647","56d46a5b8001e30b00896ebb","56f00bd1d58ed32400df6092","56f01568d58ed32400df60c1","56f0194911415c2900969c10"],"version":"564de2dbfe07a81700b5c3a8","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-11-19T16:04:49.459Z","from_sync":false,"order":1,"slug":"api","title":"API"},"project":"564de2dbfe07a81700b5c3a5","editedParams2":true,"parentDoc":null,"editedParams":true,"user":"564de2b4fe07a81700b5c3a4","updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-11-19T17:23:45.365Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"method":"get","results":{"codes":[{"name":"","code":"","language":"http","status":200}]},"settings":"564e0334e512d10d007641d3","auth":"required","params":[{"_id":"564e04e8873c362d005172b0","ref":"","in":"query","required":true,"desc":"The URL of the image to proxy. The URL must be url-encoded to ensure that Embedly retrieves the correct link.","default":"","type":"string","name":"url"},{"_id":"564e04e8873c362d005172af","ref":"","in":"query","required":false,"desc":"The URL of the fall back image to use when url fails. The URL must be url-encoded to ensure that Embedly retrieves the correct link.","default":"","type":"string","name":"errorurl"},{"_id":"564e057a873c362d005172b5","ref":"","in":"query","required":true,"desc":"The width that the image should fill.","default":"","type":"int","name":"width"},{"_id":"564e057a873c362d005172b4","ref":"","in":"query","required":true,"desc":"The height that the image should fill.","default":"","type":"int","name":"height"},{"_id":"564e057a873c362d005172b3","ref":"","in":"query","required":false,"desc":"Set to true if growing the image is allowed. Otherwise the image will never expand beyond it’s original dimensions, making width and height behave like max width and max height.","default":"false","type":"boolean","name":"grow"},{"_id":"56e037b14685db1700d94782","ref":"","in":"query","required":false,"desc":"Setting animate to false will convert the image to the first frame of animation for animated images. Setting this value on non-animated images will have non effect and is safe to do.","default":"true","type":"boolean","name":"animate"},{"_id":"56e037b14685db1700d94781","ref":"","in":"query","required":false,"desc":"Will run images through pngcompressor. Increases response time.","default":"false","type":"boolean","name":"compresspng"},{"_id":"56e037b14685db1700d94780","ref":"","in":"query","required":false,"desc":"Quality of the image between 1 and 95.","default":"","type":"int","name":"quality"}],"url":"/1/display/crop"},"isReference":true,"order":4,"body":"Crop an image to fill the given dimensions. The image will first be resized to it’s smallest possible size that will fill the entire given dimensions, preserving it’s aspect ratio. The image is then centered within the given dimensions, and any part of the image that doesn’t fit is removed. The same amount is trimmed from each side of the image in the cropping dimension.","excerpt":"Crop an image to fill the given dimensions.","slug":"crop","type":"endpoint","title":"/1/display/crop"}

get/1/display/crop

Crop an image to fill the given dimensions.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Query Params

url:
required
string
The URL of the image to proxy. The URL must be url-encoded to ensure that Embedly retrieves the correct link.
errorurl:
string
The URL of the fall back image to use when url fails. The URL must be url-encoded to ensure that Embedly retrieves the correct link.
width:
required
integer
The width that the image should fill.
height:
required
integer
The height that the image should fill.
grow:
booleanfalse
Set to true if growing the image is allowed. Otherwise the image will never expand beyond it’s original dimensions, making width and height behave like max width and max height.
animate:
booleantrue
Setting animate to false will convert the image to the first frame of animation for animated images. Setting this value on non-animated images will have non effect and is safe to do.
compresspng:
booleanfalse
Will run images through pngcompressor. Increases response time.
quality:
integer
Quality of the image between 1 and 95.

Documentation

Crop an image to fill the given dimensions. The image will first be resized to it’s smallest possible size that will fill the entire given dimensions, preserving it’s aspect ratio. The image is then centered within the given dimensions, and any part of the image that doesn’t fit is removed. The same amount is trimmed from each side of the image in the cropping dimension.