photoviewer icon indicating copy to clipboard operation
photoviewer copied to clipboard

Removed crop from base64 images

Open Virus-X opened this issue 6 years ago • 9 comments

Hi there! I'm developing application, where I need to show large image, that comes from pouchdb and I use photoviewer for that by passing base64 data. The problem I have is that image get always cropped vertically in portrait mode, and even user tries to zoom it out, he can't see some regions to the left and right sides of image. Seems that this issue was already reported here: https://github.com/sarriaroman/photoviewer/issues/143

PR contains simple fix, that worked for me. From other discussions I understood that this line was placed to fix OOM issues on android, but I haven't seen any while was testing it.

Virus-X avatar Sep 27 '18 13:09 Virus-X

Also having this issue, please merge this in asap.

WillPoulson avatar Oct 29 '18 14:10 WillPoulson

Hi there! :)

Is this project alive? Is there a way to get this merged? I'm having this issue also!

pauloamorimbr avatar Jan 07 '19 14:01 pauloamorimbr

@paulklinkenberg the project is alive. The problem with the PR is that breaks Network images. I'm reviewing the problem in a new version.

sarriaroman avatar Jan 09 '19 12:01 sarriaroman

@pauloamorimbr please check the Picasso Options for Android where you can enable or disable crop.

sarriaroman avatar Jan 09 '19 12:01 sarriaroman

@pauloamorimbr please check the Picasso Options for Android where you can enable or disable crop.

Hey, thanks very much for the answer...I didn't understand the Picasso part....what option is that?

pauloamorimbr avatar Jan 10 '19 03:01 pauloamorimbr

You can call the plugin in this way

.show('base64 uri', 'my title', {
piccasoOptions: {
centerCrop: false,
centerInside: false
}
});

That will disable centering.

sarriaroman avatar Jan 10 '19 12:01 sarriaroman

Oh...thanks a lot.

It seems the plugin is outdated on ionic-native, and it wont accept the picassoOptions parameter. Taking a look at the index.d.ts, for the photoViewerOptions interface theres only the "share" parameter defined.

I tried changing it so I could use the picassoOptions (my app platform is Android only), but it didn't take any effect.

Not sure what to do...

On Thu, Jan 10, 2019 at 10:45 AM Román A. Sarria [email protected] wrote:

You can call the plugin in this way

.show('base64 uri', 'my title', { piccasoOptions: { centerCrop: false, centerInside: false } });

That will disable centering.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sarriaroman/photoviewer/pull/148#issuecomment-453083846, or mute the thread https://github.com/notifications/unsubscribe-auth/AKW3qPyeSieqMAtej8oSGKGiQj4upVu_ks5vBzXzgaJpZM4W8pa8 .

pauloamorimbr avatar Jan 10 '19 16:01 pauloamorimbr

You must be able to use the next d.ts in you global.d.ts file:

interface IPhotoViewerOptions {
    share?: boolean;
    closeButton?: boolean;
    copyToReference?: boolean;
    headers?: string;
    piccasoOptions?: {
        fit?: boolean;
        centerInside?: boolean;
        centerCrop?: boolean;
    };
}
declare class PhotoViewer {
    static show(url: string, title?: string, options?: IPhotoViewerOptions): void;
}

This is the interface from the version 2 and the signature is the same

sarriaroman avatar Jan 10 '19 18:01 sarriaroman

Is this still an issue?

l3ender avatar Feb 18 '20 02:02 l3ender