Skip to main content

image-info


Use the image-info endpoint to get metadata from an image.

The image-info endpoint takes an HTTP POST form submission, where an image is sent as binary data.

POST https://api.dpdf.io/v1.0/image-info HTTP/1.1
Authorization: Bearer DP.xxx-api-key-xxx
info

Refer to image-info in the Client Libraries section of the Users Guide for this endpoint using the DynamicPDF API's client libraries.

Request/Response

RequestRequest DataResponse
POSTimage as byte arrayJSON document containing metadata.
   Follow us on social media for latest news!

Parameters

ParametersTypeDescription
Header
AuthorizationBearer DP.V9xxxxThe API key used to authenticate endpoint.REQUIRED
Content-typestringThe content type of the image
Request Body
Bodybyte arrayThe file data of a supported image type.REQUIRED

Image Content Types

The image-info endpoint supports the following content types.

ApplicationMIME TypeFile Extension
Bitmapimage/bmpbmp
graphic interchange formatimage/gifgif
image fileimage/iefief
JPEG imageimage/jpegjpe
JPEG imageimage/jpegjpeg
JPEG imageimage/jpegjpg
JPEG file interchange formatimage/pipegjfif
scalable vector graphicimage/svg+xmlsvg
TIF imageimage/tifftif
TIF imageimage/tifftiff
RGB bitmapimage/x-rgbrgb

Run In Postman

Example Request

curl -X POST "https://api.dpdf.io/v1.0/image-info" 
-H "accept:application/json"
-H "Authorization: Bearer DP.xxx-api-key-xxx"
-H "Content-Type: image/png"
--data-binary "@c:/holding/getting-started/getting-started.png"
important

An image is sent to the endpoint as binary data. In this example request, the binary is coming from a file, but it could also come from a URL, a database, or other source.

Example Response

[
{
"pageNumber": 1,
"width": 90,
"height": 81,
"horizondalDpi": 72.008995,
"verticalDpi": 72.008995,
"numberOfComponents": 4,
"bitsPerComponent": 16,
"colorSpace": "rgb"
}
]

Multi-Page Tiffs

The image-info endpoint also supports multi-page tiffs.

Example Request

curl -X POST "https://api.dpdf.io/v1.0/image-info" 
-H "accept:application/json"
-H "Authorization: Bearer DP.xxx-api-key-xxx"
-H "Content-Type: image/tiff"
--data-binary "@c:/holding/getting-startedmultipage.tiff"

Example Response

[
{
"pageNumber": 1,
"width": 816,
"height": 1056,
"horizondalDpi": 96,
"verticalDpi": 96,
"numberOfComponents": 3,
"bitsPerComponent": 8,
"colorSpace": "rgb"
},
{
"pageNumber": 2,
"width": 816,
"height": 1056,
"horizondalDpi": 96,
"verticalDpi": 96,
"numberOfComponents": 3,
"bitsPerComponent": 8,
"colorSpace": "rgb"
},
{
"pageNumber": 3,
"width": 816,
"height": 1056,
"horizondalDpi": 96,
"verticalDpi": 96,
"numberOfComponents": 3,
"bitsPerComponent": 8,
"colorSpace": "rgb"
},
{
"pageNumber": 4,
"width": 816,
"height": 1056,
"horizondalDpi": 96,
"verticalDpi": 96,
"numberOfComponents": 3,
"bitsPerComponent": 8,
"colorSpace": "rgb"
}
]

Further Information

You can also use one of DynamicPDF's provided client libraries to integrate the endpoints into your client applications if you prefer. For more information, refer to the relevant Users Guide sections: