Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documentation link is broken #3

Closed
kklepper opened this issue Apr 13, 2021 · 15 comments
Closed

documentation link is broken #3

kklepper opened this issue Apr 13, 2021 · 15 comments

Comments

@kklepper
Copy link

http://www.spidersoft.com.au/projects/codeigniter-img-thumbnails-on-the-fly/

@kklepper
Copy link
Author

Sorry, that's not it. spidersoft.com.au is not reachable.
image

@slav123
Copy link
Owner

slav123 commented Apr 15, 2021

www. spidersoft.com.au

@kklepper
Copy link
Author

Sorry, did you take the pain to check?

image

@slav123
Copy link
Owner

slav123 commented Apr 15, 2021

There are some issues with this domain name - I'm working on fix. It's visible from some locations - but not for everyone.

@slav123 slav123 reopened this Apr 15, 2021
@slav123
Copy link
Owner

slav123 commented Apr 18, 2021

Problems with the domain are solved. DBAA about it...

@kklepper
Copy link
Author

What do you mean with DBAA, please?

@kklepper
Copy link
Author

D:> ping www.spidersoft.com.au
Ping request could not find host "www.spidersoft.com.au". Check the name and try again.

D:> tracert www.spidersoft.com.au
The destination name www.spidersoft.com.au could not be resolved.

@kklepper
Copy link
Author

Maybe this will be fixed in a couple of hours...

@kklepper
Copy link
Author

Ok now, issue resolved.

For the record:

Well, on my Windows box it was not. But curl -v "https://www.spidersoft.com.au" worked fine on my CentOS box. So it must be an issue of DNS nameserver.

I reconfigured Windows from automatic to 8.8.8.8 / 8.8.4.4 (Google public nameserver), to no avail. So I suspected that I had to reboot, which I should not have to.

I had a lookup of the DNS nameserver on CentOS with cat /etc/resolv.conf and reconfigured Windows accordingly, again no result. (I probably did not close the dialog, so the changed data was not set.)

Next I followed the advice of my browser Opera to configure Opera to use a different nameserver. I chose the preconfigured Google option and had success.

Next I configured Windows DNS nameserver with all the different variants and all of them worked, except the default which is my Internet-provider. (I probably closed the dialog, so the changed data was set.) Well, this, too, may change. And lo, it did.

ping -n 1 www.spidersoft.com.au

Ping wird ausgeführt für www.spidersoft.com.au [198.199.126.62] mit 32 Bytes Daten:
Antwort von 198.199.126.62: Bytes=32 Zeit=81ms TTL=58

Redirect

Well, not yet. Trying http://www.spidersoft.com.au/projects/codeigniter-img-thumbnails-on-the-fly/ in Opera via Google resulted in the known error. Why? Ok, no automatic redirect to https, which is state of the art, as far as I know.

curl works fine, though. Why? Maybe because of

< X-Pingback: http://www.spidersoft.com.au/xmlrpc.php
< Link: <https://www.spidersoft.com.au/wp-json/>; rel="https://api.w.org/", <https://www.spidersoft.com.au/wp-json/wp/v2/pages/327>; rel="alternate"; type="application/json", <https://www.spidersoft.com.au/?p=327>; rel=shortlink

curl seems to know about pingbacks, I don't and I don't want to learn about it, so I leave it at that.

https://www.spidersoft.com.au/projects/codeigniter-img-thumbnails-on-the-fly/ reveals no new information but instead refers back to github-documentation, so all this effort was in vain, it seems.

Speed

By the way, my testing revealed that resizing with GraphicsMagic is roughly 10 times faster than gd.

        $cmd = "gm convert  -size $size^ $file -filter Lanczos -resize $size^ -crop $size -unsharp 2x0.5+1.0+0 -quality 70 $file_new2";
        $res = exec($cmd);

Résumé

So, in the end, this library will not be used. Learned something, though, so I don't regret the endeavor.

@slav123
Copy link
Owner

slav123 commented Apr 20, 2021

Every external library will be faster than PHP, if you are looking for real speed try https://github.com/libvips/libvips

@kklepper
Copy link
Author

Interesting, thank you!

I made me a vips-container via https://github.com/codechimp-io/vips-alpine/blob/master/Dockerfile and tested with a jpg-file 1000px wide against GraphicsMagick:

1. pick containter having GraphicsMagick

id=$(docker ps -a | grep "vx_wsm.1\." | grep -v "xited" | awk '{print $1}') && docker exec -it $id ash

in container run test

/ # time gm convert  -size 287x137^ /tmp/img/_voxx_AdMark.jpg -filter Lanczos -resize 287x137^ -crop 287x137 -unsharp 2x0.5+1.0+0 -quality 90 /tmp/img/287/_voxx_AdMark.jpg
real    0m 0.04s
user    0m 0.01s
sys     0m 0.00s

2. start vips container

docker run -it --rm -v /tmp:/tmp --name u1 kklepper/vips:alpine sh

in container run test

/ # time vipsthumbnail /tmp/img/_voxx_AdMark.jpg --size 287x137 -o /tmp/img/287/%s.jpg[Q=90,optimize_coding]
real    0m 0.43s
user    0m 0.04s
sys     0m 0.02s

Result: gm beats vips by 10x

I think vips has a lot of overhead -- no wonder, because after all -- if I understood correctly -- vips just uses ImageMagick as a submodule.

@slav123
Copy link
Owner

slav123 commented May 8, 2021

Not sure how did you run your benchmarks but: https://github.com/libvips/libvips/wiki/Speed-and-memory-use

@kklepper
Copy link
Author

kklepper commented May 9, 2021

Thank you, interesting.

Not sure how did you run your benchmarks

Well, I gave you the recipe, didn't I? My GM container is a standard PHP container with GM as addon, so nothing special.

@slav123
Copy link
Owner

slav123 commented May 9, 2021

I'm just wondering why there is a such a difference between your benchmarks and theirs. You claim that 10x faster, they are saying it's 4x slower :)

@kklepper
Copy link
Author

kklepper commented May 9, 2021

Good question. I don't know. You should be able to reproduce. I'd rather go back to work than care any longer, at least for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants