Giter VIP home page Giter VIP logo

Comments (9)

dfa1234 avatar dfa1234 commented on July 17, 2024

I don't think there is an issue.
Please try to open this link with your android browser: https://image-library.app/
If you still have issues, please details your android specification and which browser you use.

from ngx-image-compress.

aviralgoyal avatar aviralgoyal commented on July 17, 2024

You're correct it is working from the link you sent me, must be something in my code. I'll try adding some logging at each step to figure out the issue.

Also I wanted to know if there is a way to get the file name of the file uploaded from within the function. Because I need the file extension for storage.

from ngx-image-compress.

dfa1234 avatar dfa1234 commented on July 17, 2024

@aviralgoyal filename would be a good addition.
I'm adding this for fututes feature.
Meantime you can write you own "upload" function and use the this.imageCompress.compressFile function from the library.

from ngx-image-compress.

andresud avatar andresud commented on July 17, 2024

I'm having the same issue using Ionic/Angular project, I can upload a photo from file but not from gallery nor from camera... The app you passed is working fine.

from ngx-image-compress.

aviralgoyal avatar aviralgoyal commented on July 17, 2024

@andresud I found the problem, in my case I used a mobile debugging option and when I'm using the Angular Material button, the library responds with a message, user interaction is required, or something on those lines. I removed the angular button and put a normal button, it works fine. @dfa1234 There is some kind of warning added to the library, which is behaving differently in case of an angular material type button.

There is one more enhancement that I would like to request, in the uploadAndGetImageWithMaxSize(), if you could expose the size and quality parameters to help the developer choose how much the size or quality should be reduced each time the loop runs for reducing the image size to the desired size. Right now it is set at 50%, which i feel is bit too much, I think it should be somewhere around 20% or user definable which would be ideal.

from ngx-image-compress.

dfa1234 avatar dfa1234 commented on July 17, 2024

@aviralgoyal indeed we could add optional quality parameter. At first this function was done for being a lot more simple to use, with minimal configuration, when, on the contrary, this.compressImage give a lot more of control. But adding a optional parameter is not a problem. Feel free to submit some PR if you have some minutes so we will not forget it. even if the PR is not 100% ready it will help

from ngx-image-compress.

aviralgoyal avatar aviralgoyal commented on July 17, 2024

@dfa1234 I will try my level best and find time, I am yet to make my first PR, so it might take me a while to read and understand, how to do this.

I tried upload a file < 1MB on https://image-library.app/
using the option Uploading, Compressing and returning with max size of 1 MegaByte.

It is giving an error as even though it is already smaller than 1mb. It is trying to reduce the file further and as it did not succeed and goes to the error handler instead of just succeeding without compressing.

from ngx-image-compress.

dfa1234 avatar dfa1234 commented on July 17, 2024

@aviralgoyal interesting, indeed if image is already < to 1mb the promise should resolve and not reject, we will add a PR for this, or you can submit it, it can be a good exercise for you too :)

from ngx-image-compress.

dfa1234 avatar dfa1234 commented on July 17, 2024

Filename available in #89

from ngx-image-compress.

Related Issues (20)

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.