fix: ios manual image compress fixed #295
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Different 'quality' param does not affect image compression for iOS. Working fine on Android. Its related to used source image of copyExifinfo func so i chaned it. Related issue #287
Changelog
[FIX] [IOS] - Manuel image compress changed source image with compressed image source
Test Plan
Select flowers picture in ios simulator image
const thumbnailPath1 = await Image.compress(url, {
compressionMethod: 'manual',
maxWidth: 1280,
maxHeight: 1280,
quality: 1,
});
const thumbnailPath2 = await Image.compress(url, {
compressionMethod: 'manual',
maxWidth: 1280,
maxHeight: 1280,
quality: 0.75,
});
const thumbnailPath3 = await Image.compress(url, {
compressionMethod: 'manual',
maxWidth: 1280,
maxHeight: 1280,
quality: 0.5,
});
const thumbnailPath4 = await Image.compress(url, {
compressionMethod: 'manual',
maxWidth: 1280,
maxHeight: 1280,
quality: 0.25,
});
const thumbnailPath5 = await Image.compress(url, {
compressionMethod: 'manual',
maxWidth: 1280,
maxHeight: 1280,
quality: 0.1,
});
console.log('1', await getFileSize(thumbnailPath1));
console.log('2', await getFileSize(thumbnailPath2));
console.log('3', await getFileSize(thumbnailPath3));
console.log('4', await getFileSize(thumbnailPath4));
console.log('5', await getFileSize(thumbnailPath5));
Log Before PR Result:
1 605016
2 605016
3 605016
4 605016
5 605016
Log After PR:
1 829608
2 594301
3 488911
4 344909
5 609105