Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Feature Requests
  3. Image Optimization: Add optipng and jpegoptim packages for each container.

Image Optimization: Add optipng and jpegoptim packages for each container.

Scheduled Pinned Locked Moved Solved Feature Requests
13 Posts 6 Posters 1.8k Views 7 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B Offline
      B Offline
      BetterWP
      wrote on last edited by
      #1

      Hello,
      Image optimization is one of the most important things for the new web. For years now, I have been using these small magic tools on my server, which saves me time and a lot of GBs.

      Even I am using it at my home devices.

      I suggest including it with all apps so I can open the app terminal and run it using the following commands to start optimizing photos at the server level.

      nice -n 19 find . -iname '*.jpg' -print0 | xargs -0 jpegoptim --max=82 --all-progressive --strip-all --preserve --totals --force
      nice -n 19 find . -iname '*.jpeg' -print0 | xargs -0 jpegoptim --max=82 --all-progressive --strip-all --preserve --totals --force
      nice -n 19 find . -iname '*.png' -print0 | xargs -0 optipng -o7 -preserve
      

      Credit to How to optimize for faster images in WordPress

      J 1 Reply Last reply
      3
      • girishG Offline
        girishG Offline
        girish
        Staff
        wrote on last edited by
        #2

        Thanks, I have added these to the next base image. I assume this is not urgent, since this can take a bit to come to your server.

        1 Reply Last reply
        1
        • robiR Offline
          robiR Offline
          robi
          wrote on last edited by
          #3

          Until then, you can acquire the precompiled binaries and upload them to the apps that need them.

          Conscious tech

          1 Reply Last reply
          1
          • B Offline
            B Offline
            BetterWP
            wrote on last edited by
            #4

            Thanks @girish No, it isn't urgent, just an idea. I understand you will add it for all apps or just WordPress ?

            @robi interesting idea, but how to? Any docs

            1 Reply Last reply
            0
            • nebulonN Offline
              nebulonN Offline
              nebulon
              Staff
              wrote on last edited by
              #5

              It was added to the base image which all apps use, not just WordPress. See https://git.cloudron.io/cloudron/docker-base-image/-/commit/feb87a57028b4891be49b3963a70847a74e5425c

              1 Reply Last reply
              2
              • nebulonN nebulon marked this topic as a question on
              • nebulonN nebulon has marked this topic as solved on
              • B BetterWP

                Hello,
                Image optimization is one of the most important things for the new web. For years now, I have been using these small magic tools on my server, which saves me time and a lot of GBs.

                Even I am using it at my home devices.

                I suggest including it with all apps so I can open the app terminal and run it using the following commands to start optimizing photos at the server level.

                nice -n 19 find . -iname '*.jpg' -print0 | xargs -0 jpegoptim --max=82 --all-progressive --strip-all --preserve --totals --force
                nice -n 19 find . -iname '*.jpeg' -print0 | xargs -0 jpegoptim --max=82 --all-progressive --strip-all --preserve --totals --force
                nice -n 19 find . -iname '*.png' -print0 | xargs -0 optipng -o7 -preserve
                

                Credit to How to optimize for faster images in WordPress

                J Offline
                J Offline
                jagan
                wrote on last edited by
                #6

                @BetterWP said in Image Optimization: Add optipng and jpegoptim packages for each container.:

                open the app terminal and run it using the following commands to start optimizing photos at the server level.

                Can we have a button for those of us who don't want to meddle with commands on the app terminal unless they are really needed, please?!

                Do we have to run this command every now and then to optimise images as they are added to the application? If then, can we cron job it?

                1 Reply Last reply
                1
                • nebulonN Offline
                  nebulonN Offline
                  nebulon
                  Staff
                  wrote on last edited by
                  #7

                  This seems really something highly app specific, so such a button would have to be added to the app/WordPress somewhere.

                  1 Reply Last reply
                  1
                  • J Offline
                    J Offline
                    jagan
                    wrote on last edited by
                    #8

                    Sorry if this is a N00B question, but if we add this at the server level, can't we recursively optimise all images on the server, irrespective of the application?

                    Like, say:
                    [Launch] Optimise Images Tool
                    Select Applications to run image optimisation on
                    [Checklist of Apps on Server]

                    [Start Optimisation]

                    1 Reply Last reply
                    0
                    • nebulonN Offline
                      nebulonN Offline
                      nebulon
                      Staff
                      wrote on last edited by
                      #9

                      I don't think its a good idea to just blindly optimize images on the server. This may have all kinds of side-effects.

                      1 Reply Last reply
                      1
                      • A Offline
                        A Offline
                        AmbroiseUnly
                        wrote on last edited by
                        #10

                        I'm also interested in hosting such a service in Cloudron.

                        Typically, to avoid sending images to 3rd-parties not knowing what they may do with it.

                        It should be an application, like any other app.
                        Maybe this app could have a feature that automatically optimize files on the server itself, but indeed it seems like a very specific feature.

                        robiR 1 Reply Last reply
                        0
                        • A AmbroiseUnly

                          I'm also interested in hosting such a service in Cloudron.

                          Typically, to avoid sending images to 3rd-parties not knowing what they may do with it.

                          It should be an application, like any other app.
                          Maybe this app could have a feature that automatically optimize files on the server itself, but indeed it seems like a very specific feature.

                          robiR Offline
                          robiR Offline
                          robi
                          wrote on last edited by
                          #11

                          @AmbroiseUnly In the meantime you can use https://shortpixel.com

                          Conscious tech

                          1 Reply Last reply
                          2
                          • B Offline
                            B Offline
                            BetterWP
                            wrote on last edited by
                            #12

                            @nebulon I tried today but it seems isn't installed

                            /app/data/public/wp-content/uploads# nice -n 19 find . -iname '*.jpg' -print0 | xargs -0 jpegoptim --max=82 --all-progressive --strip-all --preserve --totals --force
                            
                            1 Reply Last reply
                            0
                            • girishG Offline
                              girishG Offline
                              girish
                              Staff
                              wrote on last edited by girish
                              #13

                              @BetterWP a workaround for now till we update our base image is :

                              In web terminal:

                              mkdir -p /app/data/jpegoptim
                              cd /app/data/jpegoptim
                              wget https://github.com/tjko/jpegoptim/releases/download/v1.5.5/jpegoptim-1.5.5-x64-linux.zip
                              unzip jpegoptim-1.5.5-x64-linux.zip
                              chmod +x jpegoptim
                              ./jpegoptim --help
                              
                              1 Reply Last reply
                              1
                              Reply
                              • Reply as topic
                              Log in to reply
                              • Oldest to Newest
                              • Newest to Oldest
                              • Most Votes


                                • Login

                                • Don't have an account? Register

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • Bookmarks
                                • Search