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

In iOS, cropping new image returned old image path which showed incorrect image. [Proposed Solution Inside] #8

Open
necixy opened this issue Nov 12, 2018 · 1 comment

Comments

@necixy
Copy link

necixy commented Nov 12, 2018

No description provided.

@necixy necixy closed this as completed Nov 12, 2018
@necixy necixy reopened this Nov 12, 2018
@necixy
Copy link
Author

necixy commented Nov 12, 2018

Original library was great in every manner. In iOS, there was a small bug that cropping new image returned old image path which showed incorrect image. To make file name unique and avoid name mismatch, adding intervalString as an extra layer in the file name for iOS and it solved problem (at least for me).

Following code is added in KImageCropper.m file, inside tempFilePath function:

NSTimeInterval  today = [[NSDate date] timeIntervalSince1970];
NSString *intervalString = [NSString stringWithFormat:@"%f", today];
filePath = [NSString stringWithFormat:@"%@/%@%03d_%@.%@", docsPath, CDV_PHOTO_PREFIX, i++, intervalString , extension];

Made a little forked version to address above issue and that can be found here:
https://github.com/necixy/cordova-plugin-k-imagecropper

Feel free to use forked version this if you're facing the same bug in the original library.

@necixy necixy changed the title [Proposed Solution Inside] In iOS, cropping new image returned old image path which showed incorrect image. In iOS, cropping new image returned old image path which showed incorrect image. [Proposed Solution Inside] Nov 12, 2018
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

No branches or pull requests

1 participant