Conversation #g3th6hq

Recent tws in this reply to #g3th6hq

@prologic (#g3th6hq) Okay, I had a look at the image code and noticed, that we don’t support JPEG. When requesting an image using Accept: image/jpeg, a PNG is delivered instead. Locally converting the PNG to JPEG using convert, results in a much smaller size. I used @off_grid_living’s solar panels and got the following file sizes: 312.5 KiB PNG, 214.5 KiB WebP and 76.8 KiB JPEG. For photos, JPEG’s savings are quite significant. EXIF information are stripped when uploading an image, which is fine to me, would disagree on that. ;-) Maybe the hardcoded maximum image resize width of 720 px would be something to make configurable by twtd operators.


(#g3th6hq) Thanks for your PR btw! It has been merged! 👌

Regarding image/jpeg support. Originally I designed the image processing to only really support WebP and PNG, WebP if possible and a fallback to PNG. In hindsight maybe JPEG should be supported oto? It wouldn’t take a lot of extra processing to handle this.

In an ideal world, I’d refactor the code entirely into a separate service that accepts an image upload, returns a unique URI for the resource and does the processing in the background. So that the user experience is quicker and more fluid…


(#g3th6hq) But also so I can decouple pods and twtd from having C-level dependencies and break out any “media handling / serving” to a separate thing that can scale indepently.


@prologic (#g3th6hq) No worries. I need to think about splitting the programs a bit more. Currently I’m trying to test your latest change regarding the configurable fetch interval. At the moment it looks like it’s not having any observable effect, but I’m probably doing something wrong. Back to testing.


@lyse @movq @prologic (#g3th6hq) Interesting comments Lyse. The image you speak of is 37.9KB, and I use James camera which makes a 6MB file. I than get the image in Windows 8 Photos viewer, and press Screen Shot, Paste the file into MSPaint, a primitive Paint program. I than use capture size to get the image again, and paint it again into Paint, unchanged. It is saved as a JPEG file, reducing the image from 6MB to 37.9 KB. The file is than used for Internet publishing on my website, . It would be nice if software made image files smaller automaticly


@off_grid_living (#g3th6hq) That’s an interesting observation, that the source image is even smaller! Your workflow seems overly complicated to me. Isn’t there a resize option in this image viewer? Maybe get yourself a proper image viewer. When I was on Windows decades ago I used Irfanview, not sure whether this still exists. As for dedicated image editing in a GUI, I can recommend GIMP. I reckon ImageMagick is availabe on Windows as well, you could easily automate resizing with it in a script if you have the courage to use the command line: convert -resize 400x300 -strip -quality 50 ORIGINAL.JPG RESIZED.JPG is what I use.

You must be Logged in to join the conversation.