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
Request | Request Data | Response |
---|---|---|
POST | image as byte array | JSON document containing metadata. |
Parameters
Parameters | Type | Description | |
---|---|---|---|
Header | |||
Authorization | Bearer DP.V9xxxx | The API key used to authenticate endpoint. | REQUIRED |
Content-type | string | The content type of the image | |
Request Body | |||
Body | byte array | The file data of a supported image type. | REQUIRED |
Image Content Types
The image-info
endpoint supports the following content types.
Application | MIME Type | File Extension |
---|---|---|
Bitmap | image/bmp | bmp |
graphic interchange format | image/gif | gif |
image file | image/ief | ief |
JPEG image | image/jpeg | jpe |
JPEG image | image/jpeg | jpeg |
JPEG image | image/jpeg | jpg |
JPEG file interchange format | image/pipeg | jfif |
scalable vector graphic | image/svg+xml | svg |
TIF image | image/tiff | tif |
TIF image | image/tiff | tiff |
RGB bitmap | image/x-rgb | rgb |
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:
- DynamicPDF API's Endpoints - (cloud-api-overview), and
- DynamicPDF API's Client Libraries - (cloud-api-client-libraries).