CaiJingLong / dart_image_size_getter

Use dart file api to get image size, needn't use decode. just read the metadata.
Apache License 2.0
64 stars 29 forks source link

[Feature request] Return the image type #34

Open bramp opened 1 year ago

bramp commented 1 year ago

Platforms

dart

Description

In addition to returning a size, it would be useful to return the image type (PNG, JPG, etc).

The implementation of ImageSizeGetter.getSize seems to cycle though each image format, to check if it's a valid image, and then return the size for the first valid one. It would be useful to also return the image type, so this can be used by the caller.

Why

To validate the image is the expected file format, or to just determine the file format.