22

webpsupporter Thanks. Note there is Flag as Duplicate option under Reply menu, that you can use to do this in the future

    15 days later

    The odd thing is that AVIV image support works in 0.99.123 in Catalina and doesn't seem to rely on OS level support (AVIV doesn't work in regular Safari in Catalina). But the same is not true for webp.

      Thanks for the link. That explains the fact of Safari having to wait on OS updates in order to support newer image formats but still leaves me puzzled as to why I can see AVIF images in Orion in Catalina. Does Orion use WebkitGTK as opposed to plain Webkit?

      Additionally, the reply to this Stack Overflow question is interesting. It's possible to compile webkitGTK with a webp library.

      https://stackoverflow.com/questions/71238404/webkitgtk-build-webp-libraries-were-not-found-when-i-have-installed-the-webp-l

      • Vlad replied to this.

        onerob This post is about WebP support, please keep it on topic.

        AFAIK WebKit uses system AVIF support, not built in one, and since macOS does not support AVIF for 10.x, that is why it does not work.

          I am talking about webp, though. My system (MacOS 10.15.7) doesn't support webp or AVIF but Orion does let me see AVIF. The implication is that WebKit in Orion is not relying on system support for AVIF, therefore perhaps it doesn't need to rely on system support for webp?

            onerob Those are different things. However you can ask the question on WebKit.org, specific to WebP support in Mojave and share an answer here.

              Alright, I found a solution onerob . It is far from ideal, but it does work.

              It relies on custom script execution. According to Vlad this is meant to be implemented natively soon. Keep in mind this will decode every webp image on the client side.

              Here the steps:

              1. Install https://addons.mozilla.org/en-US/android/addon/codeinjector/ in normal firefox
              2. Inside the add-on, create a new rule. Use whatever URL, it doesn't matter. As of today, the add-on is unable to detect the current loaded site in Orion.
              3. While creating the rule, go to Files. Add the following two paths and save:

              https://unpkg.com/webp-hero@0.0.2/dist-cjs/polyfills.js
              https://unpkg.com/webp-hero@0.0.2/dist-cjs/webp-hero.bundle.js

              1. Open the add-on options. Export the rule. This will save a .json file.

              2. Install the extension in Orion and import the same file.

              3. Restart Orion

              4. Open any website that loads webp images. Click on the extension, select the dropdown menu besides your rule and click "inject"

              5. Nothing will happen! You still need to apply the injection. Open the console (F12) and execute the following:

                var webpMachine = new webpHero.WebpMachine()
                webpMachine.polyfillDocument()

              6. Webp images will start loading. Done.

              Keep in mind that you will need to 1) inject the rule on every new tab and 2) execute the console commands every time new webp elements are loaded. The images will be decoded one at a time. I don't have enough time to find out how to make it work automatically. It should be possible, but extensions support is still very buggy. If you find a way, let me know.

              Vlad This should not be considered a solution for the reasons stated above. I would keep this open until something more elegant is found. WebKit has support for webp since 2013 (see https://bugs.webkit.org/show_bug.cgi?id=47512) so this might actually be activated through some compilation flag?

                Thanks for the code injection tip, webpsupporter. I think it's a bit too involved to be a realistic workaround, as I can always open the page in Firefox if I want to see the webp images.

                As for compilation flags etc.., see the Stack Overflow link above. It contains further links to two libraries needed to enable webp in WebKit (or at least WebKitGTK). These are featured in Ubuntu packages and I don't know if they're capable of working on Mac.

                  onerob Agree. In my case, I've almost moved my whole workflow to Orion, so this workaround serves some purpose at least.

                  Vlad I will try to do so over the weekend. Keep in mind that my workaround makes use of a polyfill so it is unrelated to the WebKit engine itself. On the other hand, I am not so sure if they will provide a patch/solution since Apple's port relies the OS libraries and might be marked as "invalid", but it is worth the shot I guess.

                    a month later

                    Hi, just a little update.

                    I am trying to compile WebKit myself with a series of changes. Will see where this leads.

                    Regarding @onerob curious finding, this PR might explain why you can decode AVIF in Catalina, but I haven't looked further into it. Maybe Vlad can make sense of it.

                      webpsupporter

                      Interesting. That would seem to explain it. Further down the thread we had this comment: "Looking forward to deleting this in two years 🙂", which implies that it's a temporary solution. Still, better than nothing.

                      I don't think they'd do this for webp as Catalina no longer receives Safari updates (except for security issues) so it would not be seen as something that's needed. Unfortunately.

                        Keep in mind that I am still unable to decode AVIF in Mojave.

                        On a related note, I finished compiling WebKit. There are some good news and bad news:

                        The good news are libavif and libwebp linking statically to WebKit.

                        The bad news: none of this makes a difference. There must be some set of flags that activate such function conditionally according to the OS version.

                        Sadly I don't know how to proceed at this point.

                          So close... Someone in the Webkit community would probably know the extra steps but I'd be way of my depth over there.

                            2 months later

                            WebP turns out to make more work for users.
                            Save the image from the page then send that in email to whoever, they complain the photo in the email sent to them is not viewable.
                            So have to open in Preview export as JPG and resend it for their email clients to view it.

                              10 months later

                              I hit this issue myself opening https://bbc.com on Orion/Catalina. The images are not showing (bbc uses webp). Will going to ask @dino about what are the chances realistically for Orion to support webp on older platforms.

                                Vlad This would be great! Right now I have to switch to Firefox on my Mojave/Catalina systems to view more and more sites.

                                  dino I love how everything is possible. Also I would imagine it would be incredibly hard and with everything else on our plate we'd need to find proper motivation.

                                  Everyone here:
                                  One thing we have been considering is making 10.x support Orion+ only. This would enable funding for development of this and other features which are increasingly harder to bring to 10.x (and note the incredible effort that Oriont team is investing to make the version of WebKit in Orion on 10.x be newer than WebKit Safari on Sonoma !)