Solved Shrunk images when tethering

aragats

Daemon

Reaction score: 767
Messages: 1,664

[EDIT] The title is renamed from: "Apache: shrunk images - bug or feature?"

I've noticed a strange thing. I have a FreeBSD 11.0 server with www/apache24 installed with pkg(8) and very basic configuration. When I access a web page from my laptop using my phone's Internet tethering, the images are resized by factor of 1.6. They are actually resized, I can download them using a browser or use fetch/wget -- they are shrunk.

Any ideas/directions?
Thanks!
 
Last edited:

ShelLuser

Son of Beastie

Reaction score: 2,146
Messages: 3,802

Check your logfiles, that should give some conclusive info. But I'd sooner suspect your provider to use something which optimizes bandwidth than Apache resizing contents.
 
OP
aragats

aragats

Daemon

Reaction score: 767
Messages: 1,664

Of course, I'll check the logs (traveling now), however, I've checked random images found on the Internet, and they look of correct size until copied to my server and fed out by Apache.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 13,907
Messages: 40,632

There's nothing in Apache that automatically resizes images. Not a "plain" Apache at least, there are some Apache modules that can do this though.
 

drhowarddrfine

Son of Beastie

Reaction score: 2,712
Messages: 4,630

Nowadays it's not uncommon for a web site to serve up different size images based on how you are viewing the page. I wouldn't be surprised if you found out that the way you are viewing and copying the image changes which size image you are being served because that server detected something from you.

Our web sites do this all the time and we may have as many as four or five different size images we serve based on what type of device and screen size you visit us with.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 13,907
Messages: 40,632

Yes, but this requires specific code to be built into the site itself in order to create those different sized images. Usually done by using graphics/ImageMagick. It's not something that's "automagically" done by Apache.
 
OP
aragats

aragats

Daemon

Reaction score: 767
Messages: 1,664

I wouldn't be surprised if you found out that the way you are viewing and copying the image changes which size image you are being served because that server detected something from you.
That is my server, not their :)
A particular image (not even a web page) uploaded and watched in a browser is getting resized when connected via tethering.

I've checked the logs but found nothing specific to this issue.
I still suspect that it could be AT&T (my cell service provider), but why it doesn't happen with other web sites? Will experiment more.
 
OP
aragats

aragats

Daemon

Reaction score: 767
Messages: 1,664

That's indeed the wireless service provider's trick. It happens not only with my server. Here are the results of my experiment with images from a webcam hosted by hdrelay.com:
Code:
$ fetch -o 800x450.jpg  http://b6b.hdrelay.com/cameras/0e9787f3-7961-4ae4-bd59-8cbbcd79ed31/GetOneShot?size=800x450
$ identify 800x450.jpg
800x450.jpg JPEG 800x450 800x450+0+0 8-bit sRGB 41KB 0.000u 0:00.000

$ fetch -o 1920x1080.jpg  http://b6b.hdrelay.com/cameras/0e9787f3-7961-4ae4-bd59-8cbbcd79ed31/GetOneShot?size=1920x1080
$ identify 1280x720.jpg
1280x720.jpg JPEG 800x450 800x450+0+0 8-bit sRGB 40.8KB 0.000u 0:00.000

$ fetch -o 2400x1350.jpg  http://b6b.hdrelay.com/cameras/0e9787f3-7961-4ae4-bd59-8cbbcd79ed31/GetOneShot?size=2400x1350
$ identify 1920x1080.jpg
1920x1080.jpg JPEG 1200x675 1200x675+0+0 8-bit sRGB 41.7KB 0.000u 0:00.000

$ fetch -o 1280x720.jpg  http://b6b.hdrelay.com/cameras/0e9787f3-7961-4ae4-bd59-8cbbcd79ed31/GetOneShot?size=1280x720
$ identify 2400x1350.jpg
2400x1350.jpg JPEG 1500x844 1500x844+0+0 8-bit sRGB 118KB 0.000u 0:00.000

$ du -sh [0-9][0-9]*.jpg
 45K   800x450.jpg
 41K   1280x720.jpg
 45K   1920x1080.jpg
117K   2400x1350.jpg
As you can see, it tries to keep the images to be below 50k (just guessing) by resizing them.
The same experiment run with a regular DSL ISP gives correct images resolutions and sizes.

I should probably rename this thread to reflect the actual issue...
 
Top