Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ios manual image compress fixed #295

Merged
merged 1 commit into from
Jun 14, 2024

Conversation

zaferatli
Copy link
Contributor

@zaferatli zaferatli commented Jun 14, 2024

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

@numandev1 numandev1 merged commit 9cc5927 into numandev1:main Jun 14, 2024
@numandev1
Copy link
Owner

released in 1.8.25

@zaferatli zaferatli deleted the fix/ManuelCompressImageSource branch June 14, 2024 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants