Coder Social home page Coder Social logo

Overhaul image upload about quill HOT 10 CLOSED

vickychijwani avatar vickychijwani commented on June 2, 2024
Overhaul image upload

from quill.

Comments (10)

vickychijwani avatar vickychijwani commented on June 2, 2024 1

but I don't know since whatsapp shared images are already jpeg and even those ones get broken after some time

In older app versions, even if an image was already a JPEG, it would still have been re-encoded - so the new version might fix it.

from quill.

vickychijwani avatar vickychijwani commented on June 2, 2024

I've ended up using a hybrid approach that first tries to get the image path and upload it directly, and failing that falls back to the old JPEG conversion approach. This should be more robust than both methods while preserving data integrity as far as possible. See the commit message for more details.

from quill.

vickychijwani avatar vickychijwani commented on June 2, 2024

This deserves another look after further helpful advice from StackOverflow. It should be possible to simply get an InputStream from the picked Uri and write it to a File without decoding it into a Bitmap first, that way we preserve the original encoding exactly and don't have to mess around with Uri => path conversion in a hacky way.

NOTE: Retrofit 1.x supports uploading directly from an InputStream, Retrofit 2.x also does.

Also fix #119 to avoid SecurityException on Android 6.0+.

from quill.

RcrdBrt avatar RcrdBrt commented on June 2, 2024

Images inserted into articles from the Quill app end up displaying the broken image icon (see below) after some time (undefined amount of time ranging from 2 days to 2 weeks on avg) for no apparent reason.
Images uploaded from the ghost web admin interface from a desktop PC do not suffer this.

broken image icon ---> r390n

I saw on the 1.5.4 release you addressed some image upload problems. Is that fix related to the problem I described above and this issue?

By the way many thanks Vicky, your project is awesome and deserves eternal respect (plus official Ghost Foundation baking in my opinion).

from quill.

vickychijwani avatar vickychijwani commented on June 2, 2024

@RcrdBrt if the URL for the image is still correct after the broken image shows up, and if the same image is still correctly displayed on the Ghost web interface, then the likely culprit is your internet connection. Could you try going to App Settings, clear the cache, and open the post again with a stable connection? At least that would confirm the problem.

from quill.

RcrdBrt avatar RcrdBrt commented on June 2, 2024

The url is fine when the image breaks, it was the first thing that came to my mind to troubleshoot this. Those images are displayed correctly for like 2 weeks and then suddenly the Ghost blog fails to "render" them both on mobile and desktop. I downloaded the actual files uploaded from the app via rsync and I can open and watch them just fine (also their thumbnails if it can help) from a random image viewer or even Google Chrome.

from quill.

vickychijwani avatar vickychijwani commented on June 2, 2024

I see. Can you try the cache clearing workaround I described above?

from quill.

RcrdBrt avatar RcrdBrt commented on June 2, 2024

Sure, I'll let you know if it still happens.

Thanks!

from quill.

vickychijwani avatar vickychijwani commented on June 2, 2024

Oh you know what, I just read your previous comment carefully and noticed you said it fails to render even on desktop. That's... interesting, and strange.

I think the new update (v1.5.5) might fix the issue, because before this I used to convert (i.e., decode and re-encode) the image to a JPEG (even if it was already a JPEG), but now I upload the image exactly in its original format. Let me know if you still see it after updating to 1.5.5 and uploading some new images.

from quill.

RcrdBrt avatar RcrdBrt commented on June 2, 2024

Yeah, it fails on desktop too. I thought that maybe there was some shared cache system I wasn't aware of and I was trying to do your suggestion anyway.
I read about the JPEG not-necessary compression your app does. I hope that is the issue, but I don't know since whatsapp shared images are already jpeg and even those ones get broken after some time if I upload them with Quill.

from quill.

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.