Git Product home page Git Product logo

photoviewer's People

Contributors

anatoly-spb avatar barrioskh avatar bernhardwaidacher avatar dawidfiruzek avatar eggmeister avatar epicfaace avatar harshzalavadiya avatar jrschifa avatar ludufre avatar paulklinkenberg avatar rangerrick avatar rdespoiu-donlen avatar sarriaroman avatar smelzer avatar stromgren avatar thiagoprz avatar tobiasmuecksch avatar vegardlarsen avatar wlclass avatar xmbeat avatar yammusic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

photoviewer's Issues

Title / Share function

Finally someone managed to develop a working solution for both iOS and Android with Remote Image support. And no picture intent on android. 👍 👍 💯 You can't imagine how thankful I am!

Just two small things:

Title for image and Gallery modus (array of images)
UIDocumentController support title, just a small adjustment, but I don't know if Andorid support's title

Feature request: Gallery

As suggested in #3, own issue for that:

Ability to pass more than 1 image (like a gallery)

var images = 
{
   url: 'http....',
   title: 'My nice title', // or empty
   saveAble: true/false (just an idea)
},
{
  url: 
 ...
 ...
}

But I'm not sure if UIDocumentController can handle multiple images..

android build error

sarriaroman/PhotoViewer/PhotoViewer.java:37: error: cannot find symbol
if (cordova.hasPermission(READ) && cordova.hasPermission(WRITE)) {
^
looks like its missing the permission helper to work with older cordova 5 versions.

Only very first image load works (Android)

I'm using this plugin in a ionic project. I'm calling a function on ng-click event triggered on a element. The function calls "PhotoViewer.show(url);":

<a ng-click="openImage(attachment.path)">
   <img src="{{attachment.thumbnail}}"/>
</a>
$scope.openImage = function(url)
{
     PhotoViewer.show(url);
};

The first time I click the link the image is loaded successfully. The second and subsequent times I got a toast that says "Error loading image.". After that, any other link I click I got the same error message, so I need to restart my app.

I tried change the event from "ng-click" to "on-touch" and add a random GET parameter to my URL to avoid any cache. No success.

I also alerted the url that is sended to "openImage()" function and it is correct.

I'm running:
Cordova CLI 6.3.1
Ionic: 1.3
Ionic cli: 2.1.0
Android 4.4.2

Using Cocoapods for iOS breaks Cordova CLI tools

Since the iOS source requires the use of Cocoapods, the Cordova CLI tool cannot compile:

ld: library not found for -lPods-AFNetworking clang: error: linker command failed with exit code 1 (use -v to see invocation)

As a result I have to fork this project and strip out the iOS code.

iOS: Title won't reset

Hi @sarriaroman,

when I open an image on iOS with a title, and the next time, I open one without a title, it will show the last title (I guess you need to reset some var on re-open)

Won't compile (Cordova 4.3.0, Android lib 3.7.1)

After adding the plugin, when I try to cordova run android, I get:

[javac] /Users/jules/Documents/workspace/groupahead-mvp/platforms/android/src/com/speryans/PhotoViewer/PhotoActivity/PhotoActivity.java:12: error: package com.speryans.palmira does not exist [javac] import com.speryans.palmira.R; [javac] ^ [javac] /Users/jules/Documents/workspace/groupahead-mvp/platforms/android/src/com/speryans/PhotoViewer/PhotoActivity/PhotoActivity.java:24: error: package R does not exist [javac] setContentView(R.layout.activity_photo); [javac] ^ [javac] /Users/jules/Documents/workspace/groupahead-mvp/platforms/android/src/com/speryans/PhotoViewer/PhotoActivity/PhotoActivity.java:28: error: package R does not exist [javac] photo = (ImageView) findViewById(R.id.photoView); [javac] ^ [javac] /Users/jules/Documents/workspace/groupahead-mvp/platforms/android/src/com/speryans/PhotoViewer/PhotoActivity/PhotoActivity.java:36: error: package R does not exist [javac] ((LinearLayout) this.findViewById(R.id.fullscreen_content_controls)).setVisibility(View.GONE);

Still maintained?

Is this plugin still in active development? I would love to implement it but when looking at the issues this doesn't seem to be a good idea at this point.

When can we expect some prioritising of open issues and bug fixes? :)

iOS -> background overlay stay after close

Hi,

if open image and then close it and do it multiple times the background Overlay stay on top and I need to click on active buttons to disable Overlay...

maybe activityIndicator.layer setBackgroundColor has problem...

tested on iPad 10.0

img_0055

Reasoning for requiring external storage permissions?

After having read the code, there seems to be no reason for requiring external storage permissions except wanting to write to the downloads folder?

Couldn't this just as easily use getDownloadCacheDirectory or getDataDirectory to get a folder that does not require these permissions? I am not an Android developer, so I don't know the specifics of what requires permission, but these seem to be safe.

PhotoViewer doesn't work with large images

It seems that PhotoViewer doesn't work with large images. E.g.:

PhotoViewer.show('http://alarp.works-organiser.com/urt/system/photos/photos/000/000/244/original/DSC00051.JPG?1452406132', 'DSC00051.JPG');

The files size is 7468422 Bytes, the image resolution 5152x3864.

It returns immediately with "Error loading image" on an Android Virtual Device (AVD) with 1GB RAM and Android 4.4.2. On a Samsung S4 mini also with Android 4.4.2 and 1.5 GB RAM it sometimes returns immediately sometimes "spins" forever.

An other, smaller (2 MB, 3088x3088) works but very slow (and even the orientation is ignored):

PhotoViewer.show('http://alarp.works-organiser.com/urt/system/photos/photos/000/000/054/original/20151014_152321.jpg?1444906627', 'DSC01165.JPG');

Much smaller images are working perfectly.

Compile Error

-pre-compile:

-compile:
[javac] Compiling 13 source files to /project/bin/classes
[javac] /project/src/com/sarriaroman/PhotoViewer/PhotoActivity.java:3: error: package uk.co.senab.photoview does not exist
[javac] import uk.co.senab.photoview.PhotoViewAttacher;
[javac] ^
[javac] /project/src/com/sarriaroman/PhotoViewer/PhotoActivity.java:19: error: package com.squareup.picasso does not exist
[javac] import com.squareup.picasso.Picasso;
[javac] ^
[javac] /project/src/com/sarriaroman/PhotoViewer/PhotoActivity.java:26: error: cannot find symbol
[javac] private PhotoViewAttacher mAttacher;
[javac] ^
[javac] symbol: class PhotoViewAttacher
[javac] location: class PhotoActivity
[javac] /project/src/com/sarriaroman/PhotoViewer/PhotoActivity.java:94: error: cannot find symbol
[javac] mAttacher = new PhotoViewAttacher(photo);
[javac] ^
[javac] symbol: class PhotoViewAttacher
[javac] location: class PhotoActivity
[javac] /project/src/com/sarriaroman/PhotoViewer/PhotoActivity.java:127: error: package com.squareup.picasso does not exist
[javac] .into(photo, new com.squareup.picasso.Callback() {
[javac] ^
[javac] /project/src/com/sarriaroman/PhotoViewer/PhotoActivity.java:125: error: cannot find symbol
[javac] Picasso.with(this)
[javac] ^
[javac] symbol: variable Picasso
[javac] location: class PhotoActivity
[javac] Note: /project/src/org/apache/cordova/splashscreen/SplashScreen.java uses or overrides a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] 6 errors

BUILD FAILED
/android-sdk/tools/ant/build.xml:716: The following error occurred while executing this line:
/android-sdk/tools/ant/build.xml:730: Compile failed; see the compiler error output for details.

Gif viewer

I have tried to open gif image with it's url but the result is not animated.
It could be great to support gif.
Thank you for your plugin anyway !

Windows resize with AdMob banner when close photo

I've active AdMob banner that resize the total view automatically.

But when I open and close a photo with the plugin photoviewer, the height of the view change and the bottom of the page goes under the AdMob banner.

There is a solution?

IOS - 404 error - Stuck on loading spinner

Hi, thanks for your excellent plugin and your effort.

I have a problem (IOS - 10). The viewer hangs (stuck permanently) if the image is missing o the server returns 404 error. It shows only the spinner and i don’t have an option to go back or cancel the request. For example: www.404errorpages.com/error.jpg

In Android shows “Error loading image”

Thanks!!

errors when cordova build android

Here is the log..
`:dexDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:579)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:517)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:164)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:504)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)

FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':dexDebug'.

    com.android.ide.common.internal.LoggedErrorException: Failed to run command:
    /Users/yaoxingtang/Library/Android/sdk/build-tools/23.0.2/dx --dex --no-optimize --output /Users/yaoxingtang/maybi/maybi-ionic/platforms/android/build/intermediates/dex/debug --input-list=/Users/yaoxingtang/maybi/maybi-ionic/platforms/android/build/intermediates/tmp/dex/debug/inputList.txt
    Error Code:
    2
    Output:

    UNEXPECTED TOP-LEVEL EXCEPTION:
    com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
    at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:579)
    at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:535)
    at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:517)
    at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:164)
    at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
    at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:504)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
    at com.android.dx.command.dexer.Main.run(Main.java:277)
    at com.android.dx.command.dexer.Main.main(Main.java:245)
    at com.android.dx.command.Main.main(Main.java:106)

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 27.942 secs

/Users/yaoxingtang/maybi/maybi-ionic/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /Users/yaoxingtang/maybi/maybi-ionic/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/yaoxingtang/maybi/maybi-ionic/platforms/android/build.gradle,-Dorg.gradle.daemon=true
ERROR building one of the platforms: Error: /Users/yaoxingtang/maybi/maybi-ionic/platforms/android/cordova/build: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: /Users/yaoxingtang/maybi/maybi-ionic/platforms/android/cordova/build: Command failed with exit code 1`

Help

Build issues with Adobe build using https://build.phonegap.com

-compile:
[javac] Compiling 55 source files to /project/bin/classes
[javac] /project/src/com/sarriaroman/PhotoViewer/PhotoActivity.java:3: error: package uk.co.senab.photoview does not exist
[javac] import uk.co.senab.photoview.PhotoViewAttacher;
[javac] ^
[javac] /project/src/com/sarriaroman/PhotoViewer/PhotoActivity.java:21: error: package com.squareup.picasso does not exist
[javac] import com.squareup.picasso.Picasso;
[javac] ^
[javac] /project/src/com/sarriaroman/PhotoViewer/PhotoActivity.java:31: error: cannot find symbol
[javac] private PhotoViewAttacher mAttacher;
[javac] ^
[javac] symbol: class PhotoViewAttacher
[javac] location: class PhotoActivity
[javac] /project/src/com/sarriaroman/PhotoViewer/PhotoActivity.java:107: error: cannot find symbol
[javac] mAttacher = new PhotoViewAttacher(photo);
[javac] ^
[javac] symbol: class PhotoViewAttacher
[javac] location: class PhotoActivity
[javac] /project/src/com/sarriaroman/PhotoViewer/PhotoActivity.java:141: error: package com.squareup.picasso does not exist
[javac] .into(photo, new com.squareup.picasso.Callback() {
[javac] ^
[javac] /project/src/com/sarriaroman/PhotoViewer/PhotoActivity.java:139: error: cannot find symbol
[javac] Picasso.with(this)
[javac] ^
[javac] symbol: variable Picasso
[javac] location: class PhotoActivity
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 6 errors

Android - Error: Failed to find provider info

Test: Android 7.1.1 -> Nexus 5X

01-25 15:25:29.900: E/ActivityThread(3953): Failed to find provider info for 
01-25 15:25:29.901: W/ImageView(3953): Unable to open content: content:///storage/emulated/0/Android/data/com.donde.djmix/cache/pexels12.jpg
01-25 15:25:29.901: W/ImageView(3953): java.io.FileNotFoundException: No content provider: content:///storage/emulated/0/Android/data/com.donde.djmix/cache/pexels12.jpg

Plugin should use a background thread

Not an error, but an enhancement for performance. iOS only

Logs from Xcode: THREAD WARNING: ['PhotoViewer'] took '25.724854' ms. Plugin should use a background thread.

How to use with local image

Hi, i want to use with local image like: PhotoViewer.show('img/plan.jpg', 'Plan');

It's possible?

Thanks!

Android does not work with cordova file plugin

When I use the file-uri resource from cordova file plugin, the image will not load. It works fine on iOS, but not on android. Path is something like this:

content://media/external/images/media/...

            navigator.camera.getPicture(function( imgdata ) 
            {

                //console.log(imgdata);

                if (imgdata.substring(0,21)=="content://com.android") {
                    photo_split=imgdata.split("%3A");
                    imgdata = "content://media/external/images/media/"+photo_split[1];
                }

Src of my image is "imagedata", which works perfectly fine. But sadly it does not show in the PhotoViewer. Seems like iOS UIDocumentationController will automatically handle internal urls

PhotoViewer crashes with base64 image of 200kb and above

If you try loading an image above 200kb in base64, the app completely crashes. This is repeatable.

This shouldn't happen as that's not a large image.

Is this a known bug or what?

I'm testing with Ionic 2 RC3 and Android 7 on a Nexus 5, 5x and 6.

Cancel PhotoViewer

Hey,

first of all thanks for the plugin.

I've a question: Is there a way to cancel PhotoViewer once PhotoViewer.show() is called? I've the problem that some images take very long to load and I'd like to implement a timeout handler.

Premission

I view the photo from url. but it will need to get the internal photo permission.
please consider to disable getPermission() when get photo from url.
As a user. i believe they may feel suspicious and delete the app because of the unnecessary popup permission.

Stuck on loading spinner

Hi there,

I've followed a few posts and Ionic docs in using PhotoViewer, below is my code so far. The URL is passed okay but after tapping on the image - it will get stuck permanently with a loading spinner with no way of getting out. Any hints or clues as to why this might be happening?

Any help would be greatly appreciated.

`
import { PhotoViewer } from 'ionic-native';

@component({
selector: 'hero-image',
template: <div class="show-detail-image" [style.background-image]="'url(' + model.item.image + ')'" tappable> <img class="show-detail-image" [src]="model.item.image" (click)="viewFullScreenImage('url(' + model.item.image + ')', 'Detail View')"/> <ion-row class="hero-image-header-container"> <ion-col> <h6 class="hero-image-content-header"> {{model.item.name}} </h6> </ion-col> </ion-row> </div>,
directives: [ ProtectedDirective ]
})
export class HeroImageComponent {
@input() public model:Param;
public PhotoViewer: any;

constructor(
private _platform: Platform
) {
}

viewFullScreenImage(image: string, title?: string): void {
console.log('View Image in Fullscreen clicked');
this._platform.ready()
.then(() => {
if (PhotoViewer)
PhotoViewer.show(image, title);
})
console.log('Image', image);
}
`

Problem to load images of size more than 100KB

Trying to open image in PhotoViewer with high dimension image & size of every image is more than 100 KB but it's not opening in PhotoViewer.

It's giving me an below error in android studio monitor,
THREAD WARNING: exec() call to PhotoViewer.show blocked the main thread for 62ms. Plugin should use CordovaInterface.getThreadPool().

iOS Crash on 404

If image does not exist, app will crash. Please add additional checks.

Hide / Delete share-button

I have been trying to get rid of the share-image button, as it does makes no sense to share an image in my application. I tried to delete the ImageButton tag in the activity_photo.xml, but this does not change anything.

Could somebody help me with this?

Thank you!

Run in the browser: is it possible?

Hi! I'm using the plugin in an Ionic 2 app, and I'm building now an PWA.
When the app tries to use the Photo Viewer, the browser outputs the following:

Error: exec proxy not found for :: PhotoViewer :: show

Is there any way to use it in the browser, or it depends on cordova (and the best is check which is the environment, and if it is browser, don't use the Photo Viewer)?

Thanks in advance!

IOS10, IPhone7

There is a error in saving photos to photo library, and causes app to exit.

There is no prompt for users to grant permission either.

Sharing not working in Android

The sharing feature does not work. When clicking on the share icon, nothing happens.

Any help?

I tried only in my Moto G third generation with Android 6.

Android: View local URI: Out Of Memory

When I try to view local URI my application crashes with

  • fixed java.lang.OutOfMemoryError when open local URI:
    02-03 15:10:50.836: E/AndroidRuntime(32577): java.lang.OutOfMemoryError
    02-03 15:10:50.836: E/AndroidRuntime(32577): at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
    02-03 15:10:50.836: E/AndroidRuntime(32577): at android.graphics.BitmapFactory.decodeStreamInternal(BitmapFactory.java:613)
    02-03 15:10:50.836: E/AndroidRuntime(32577): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:589)
    02-03 15:10:50.836: E/AndroidRuntime(32577): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:422)
    02-03 15:10:50.836: E/AndroidRuntime(32577): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:840)
    02-03 15:10:50.836: E/AndroidRuntime(32577): at android.graphics.drawable.Drawable.createFromStream(Drawable.java:791)
    02-03 15:10:50.836: E/AndroidRuntime(32577): at android.widget.ImageView.resolveUri(ImageView.java:660)
    02-03 15:10:50.836: E/AndroidRuntime(32577): at android.widget.ImageView.setImageURI(ImageView.java:399)
    02-03 15:10:50.836: E/AndroidRuntime(32577): at com.sarriaroman.PhotoViewer.PhotoActivity.loadImage(PhotoActivity.java:164)
    02-03 15:10:50.836: E/AndroidRuntime(32577): at com.sarriaroman.PhotoViewer.PhotoActivity.onCreate(PhotoActivity.java:93)

I have fixed the problem locally the following:

src/android/PhotoActivity.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/android/PhotoActivity.java b/src/android/PhotoActivity.java
index 9a17c0c..dd6d8a8 100644
--- a/src/android/PhotoActivity.java
+++ b/src/android/PhotoActivity.java
@@ -135,7 +135,7 @@ public class PhotoActivity extends Activity {
*
*/
private void loadImage() {

  •   if( imageUrl.startsWith("http") ) {
    
  •   if( imageUrl.startsWith("http") || imageUrl.startsWith("file") ) {
      Picasso.with(this)
      		.load(imageUrl)
      		.fit()
    

Cant make any http requests after adding the plugin

After I add the plugin, I cant make any Ajax calls to my end points which returns JSON. All Ajax calls fails with timeout or is stuck with pending for a long time. Once I remove this plugin everything works again without any changes. I don't see any logs in my console and also I am not even using the methods exposed by this plugin anywhere in my source.

TypeScript Error: No exported member

Hello,

I have installed photoviewer ionic-native extension. But i am getting below error, please check.

TypeScript error: /Users/AdityaBatra/Documents/ionic/sidemenuapp/app/pages/placeinfo/placeinfo.ts(4,10): Error TS2305: Module '"/Users/AdityaBatra/Documents/ionic/sidemenuapp/node_modules/ionic-native/dist/index"' has no exported member 'PhotoViewer'.

Preserve Aspect Ratio

First of all, thanks for the Plugin.

I wonder if it is possible to preserve the aspect ratio of the image - the image always stretches over the whole width and height of the screen.

Is this possible?

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.