Giter Site home page Giter Site logo

Photo compression about project-phoenix HOT 5 CLOSED

gordon-cs avatar gordon-cs commented on July 20, 2024
Photo compression

from project-phoenix.

Comments (5)

eanyanwu avatar eanyanwu commented on July 20, 2024 1

🐉 🐲 Steph is embracing inconsistency and messiness! Wow i would not think this day would come. Both client AND server-side resizing?!!?? Wow. Much nice.
I like.
I would suggest at least resize to 300x300? Maybe a bit bigger?

from project-phoenix.

superpowers11 avatar superpowers11 commented on July 20, 2024

Originally, I had planned to do this on the server side, as I didn't want to hold up the client by making it resize an image. I implemented this in the RciInputController (see commit de9113d).
Note: As of now, images are being resized to 200x200 pixels. For some images, when they are enlarged in the modal, this results in some loss of picture quality. Do we want to go this small then?

However, when I tested with an image from my phone, which takes high resolution images (~6.25 MB), I found that there is a limit on the size of Http Requests, such that the image could not even be sent to the server to be resized.

Thus, I am currently looking into a client side solution.
Possibilities here and here

UPDATE: I am thinking of utilizing both a server side resize method and a client side resize method. In the logic, I will implement some check on the file size. If it exceeds the Http Request limit, then we resize in the client. If not, send it on to the server to get resized there.

Pros:

  • Improve client side performance whenever possible, so that the browser is not wasting computation resizing images that the server can do asynchronously.

Cons:

  • At times, there will be some inconsistency in the quality of one photo that is displayed, because when it is first uploaded, if it is not resized on the client, then the loss of quality will not be reflected until the page is reloaded. I don't think this is too significant of a problem, as users will probably not reload the page while inputting very often.

from project-phoenix.

superpowers11 avatar superpowers11 commented on July 20, 2024

I just realized it is possible to adjust the Http Request content limit, which means all the photos can be resized in the server. This will save us having to maintain two different parts of the code for resizing images.
I am thinking of implementing some limit (reasonably high ceiling -10MB), which would give the user an error saying photo exceeds photo size allowed.
Thoughts?

from project-phoenix.

eanyanwu avatar eanyanwu commented on July 20, 2024

That seems reasonable by me!

from project-phoenix.

superpowers11 avatar superpowers11 commented on July 20, 2024

Closed with #100

from project-phoenix.

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.