Chimera-1.70p1 - old browser reborn...

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#16 Post by goingnuts »

Use of stb_image for build in image handling now working - so bmp, png, jpg, tga a.o image formats no more need external loaders. Uploaded new build script and patches - and a fresh pet-package - in first post.
Missing support for tif and svg but there might be solutions for that too.
Static linked bin using uclibc and tinyxlib (+upx) is now 290K...

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#17 Post by technosaurus »

goingnuts wrote:Missing support for tif and svg but there might be solutions for that too.
My image viewer that you patched uses nanosvg which is quite small and uses the same output format as stb_image... does anyone come across tiff files in web pages anyhow? I'd probably add webp before tiff.

Edit:
There is another example patch to use them for an older version of jwm at https://gist.github.com/technosaurus/76 ... bdcc81d1fb
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#18 Post by goingnuts »

Unfortunatly chimera postproces the image delivered by stb_image so quality decrease. Tried a lot of different ways to modify the source to avoid this - but with no luck. Would be cool to let stb_image handle all images and stripout all original image code. Eventually use it as a cheap image browser as well.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#19 Post by technosaurus »

I'd have to look at the code, but i assume it has to do with resizing (there is another stb_* header for image resizing)... I'm currently moving, so will be posting from my phone till September, but if someone puts it on GitHub, I can take a look though.

IIRC, netsurf-framebuffer isn't much bigger statically compiled with xcb... most of the size is openSSL, but that could be eleminated by using curl equivalents and using a lighter SSL backend.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#20 Post by goingnuts »

Resizing seems not the problem (chimera does not resize images) but more likely function "reduce" from xloadimage - reduces colors to max 256.
The external conversion from img->jpg and then from jpg->gif (via img2jpg and djpeg) gives no problems with image quality (but slow down browsing...).
So worked further with img2jpg and reduced bin size more by using tiny_jpeg.h to replace libjpeg (for writing jpg). Source attached.

If external image-conversion should be optimized further (in respect to chimera users) - a direct conversion from img2gif would be nice, but I found no simple gif-writer.

Also attached screen shot of chimera using internal stb_image (left image) and chimera using external img2jpg/djpeg (right image) - showing the decrease in image quality.
Attachments
snap0005.png
(197.3 KiB) Downloaded 296 times
img2jpg-0.2.tar.gz
(211.45 KiB) Downloaded 135 times

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#21 Post by greengeek »

goingnuts wrote:Resizing seems not the problem (chimera does not resize images) but more likely function "reduce" from xloadimage - reduces colors to max 256.
I was hoping to use xloadimage to quickly display jpg images from cli but it appears missing from my Slacko 5.6 derivative. Is it something you would expect to be in most Puppies? I tried various spellings and capitalisations but no joy.

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#22 Post by goingnuts »

You can find xloadimage-4.1 source here. The above referenced xloadimage is part of chimera-source.
You might want to try my xvl-0.1 from my xwoaf-rebuild-project - binary attached. It supports jpg, png, gif and bmp on various screen depths.
Attachments
xvl.gz
fake.gz-extention
(88.62 KiB) Downloaded 142 times

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#23 Post by greengeek »

Thanks goingnuts. I have just tried your xvl but I must be getting the wrong syntax:

Code: Select all

# xvl -v /root/test.jpg
PNG/BMP/JPG/GIF to JPEG image converter
PNG/BMP/JPG/GIF to JPEG image viewer
Usage: img2jpg [-v] [-s] [-i input.png] [-o output.jpg]
       -i input.png  : input IMAGE file
       -o output.jpg : output JPEG file (default input.jpg)
       -s stdout     : output JPEG file to stdout
       -v viewer     : view image
I am looking for the lightest possible jpg viewer so I can produce a slideshow of jpg imges that come from my "security webcam" script. I am seeking to display sequential images at a rate that makes them look like a movie in fast forward so the user can review the webcam activity in a short timeframe. thread here

Can you suggest an appropriate syntax for me to view /root/test.jpg with xvl please?

cheers!

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#24 Post by goingnuts »

This should do:

Code: Select all

./xvl -v -i /root/test.jpg
. Hope it works for you.
I realise that the name in the help should be changed to xvl.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#25 Post by greengeek »

Great. Many thanks - that works. One of the options I should have tried :-)
cheers!

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#26 Post by greengeek »

I don't know if this is the right place for this question, but can anyone suggest the most lightweight method for displaying a jpg image? (i don't need to display other formats - just jpg).
Thanks!

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#27 Post by greengeek »

Tried compiling xloadimage but got the following errors:

Code: Select all

loadimage\" rlelib.c
In file included from rlelib.c:15:0:
/usr/lib/gcc/i486-slackware-linux/4.7.1/include/varargs.h:4:2: error: #error "GCC no longer implements <varargs.h>."
/usr/lib/gcc/i486-slackware-linux/4.7.1/include/varargs.h:5:2: error: #error "Revise your code to use <stdarg.h>."
make[1]: *** [rlelib.o] Error 1
make[1]: Leaving directory `/root/Downloads/xloadimage.4.1'
make: *** [default] Error 2
# 
Sorry - I'm not very good at this stuff. Any tips appreciated,
cheers

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#28 Post by amigo »

fedora is bound to have patches that should be applied to that before compiling.
Here's the src.rpm which contains all the build-time stuff:
https://kojipkgs.fedoraproject.org//pac ... 27.src.rpm

Yeah, 27 patches in there. 19 of them are *.dpatch files, so they come originally from debian or ubuntu, so you might want to check current debian sources for any other recent patches to it. With both, you may want to avoid some patches which add features you don't want.

Post Reply