Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface IGraphicsUtils

interface IGraphicsUtils
Extends com.amazon.apmf.IStandard Utility interface for image utility operations that do not require full pixel decoding. Currently supported formats are PNG, JPEG, and WebP.

Methods

getImageSize()

SizeI getImageSize(u8[] encodedData)
Returns the dimensions of an encoded image by reading format headers only, without decoding pixels or allocating a pixel buffer. Supported formats: EncodedImageFormat. For unsupported formats, an InvalidArgumentError is thrown.

Parameters

encodedData
u8[] — Required The array of encoded image bytes. Minimally, a validly encoded header must be present in the provided data. Must not be null.

Returns

SizeI A SizeI containing the original image width and height.

Throws

  • InvalidArgumentError — if encodedData is null, encoded data array size is 0, or a valid image header cannot be found in the provided data.

Last modified on October 29, 2026