(A)ImageDecoder: fix sampled dimensions with exif
Test: I138ec784a77253c7ae94765d0670e5947d97caf5 Recently (Ib93b0ced09fa3cca4a6681745406355c48158fae), handling exif moved from SkAndroidCodec to hwui/ImageDecoder. This missed getSampledDimensions, which reports the sampled dimensions without taking exif into account. Fix this for both android.graphics.ImageDecoder and AImageDecoder. Note that in the Java case, the method is private, and although the method was returning swapped dimensions in some cases, it gets corrected by getTargetDimension, so there is no user visible change. Change-Id: I918328c39d6230ae6ba4cab0733fff0732b39888
This commit is contained in:
@@ -353,7 +353,7 @@ int AImageDecoder_computeSampledSize(const AImageDecoder* decoder, int sampleSiz
|
||||
return ANDROID_IMAGE_DECODER_BAD_PARAMETER;
|
||||
}
|
||||
|
||||
SkISize size = toDecoder(decoder)->mCodec->getSampledDimensions(sampleSize);
|
||||
SkISize size = toDecoder(decoder)->getSampledDimensions(sampleSize);
|
||||
*width = size.width();
|
||||
*height = size.height();
|
||||
return ANDROID_IMAGE_DECODER_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user