Stay organized with collections
Save and categorize content based on your preferences.
ImageInfo
class ImageInfo
Information about an encoded image.
Summary
Public methods |
open ColorSpace? |
If known, the color space the decoded bitmap will have.
|
open String |
The mimeType of the image.
|
open Size |
Size of the image, without scaling or cropping.
|
open Boolean |
Whether the image is animated.
|
Public methods
getColorSpace
open fun getColorSpace(): ColorSpace?
If known, the color space the decoded bitmap will have. Note that the output color space is not guaranteed to be the color space the bitmap is encoded with. If not known (when the config is Bitmap.Config.ALPHA_8
for instance), or there is an error, it is set to null.
getMimeType
open fun getMimeType(): String
The mimeType of the image.
Return |
String |
This value cannot be null . |
getSize
open fun getSize(): Size
Size of the image, without scaling or cropping.
Return |
Size |
This value cannot be null . |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# ImageDecoder.ImageInfo\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nImageInfo\n=========\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/graphics/ImageDecoder.ImageInfo \"View this page in Java\") \n\n```\nclass ImageInfo\n```\n\n|---|----------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.graphics.ImageDecoder.ImageInfo](#) |\n\nInformation about an encoded image.\n\nSummary\n-------\n\n| Public methods ||\n|-----------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|\n| open [ColorSpace](/reference/kotlin/android/graphics/ColorSpace)? | [getColorSpace](#getColorSpace())`()` If known, the color space the decoded bitmap will have. |\n| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [getMimeType](#getMimeType())`()` The mimeType of the image. |\n| open [Size](../util/Size.html#) | [getSize](#getSize())`()` Size of the image, without scaling or cropping. |\n| open [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isAnimated](#isAnimated())`()` Whether the image is animated. |\n\nPublic methods\n--------------\n\n### getColorSpace\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getColorSpace(): ColorSpace?\n```\n\nIf known, the color space the decoded bitmap will have. Note that the output color space is not guaranteed to be the color space the bitmap is encoded with. If not known (when the config is [Bitmap.Config.ALPHA_8](/reference/kotlin/android/graphics/Bitmap.Config) for instance), or there is an error, it is set to null. \n\n### getMimeType\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getMimeType(): String\n```\n\nThe mimeType of the image.\n\n| Return ||\n|----------------------------------------------------------------------------------|------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | This value cannot be `null`. |\n\n### getSize\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getSize(): Size\n```\n\nSize of the image, without scaling or cropping.\n\n| Return ||\n|----------------------------|------------------------------|\n| [Size](../util/Size.html#) | This value cannot be `null`. |\n\n### isAnimated\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun isAnimated(): Boolean\n```\n\nWhether the image is animated.\n\nIf `true`, #decodeDrawable will return an [AnimatedImageDrawable](/reference/kotlin/android/graphics/drawable/AnimatedImageDrawable)."]]