The presence of an image lacking metadata when uploading to PHP

Some site that I know recently updated its band from 2.5 TB monthly to 3.5 TB.

The reason is that they overcame the 2.5 limit recently. They complain they don’t know how to reduce bandwidth usage.

One thing I have not seen is the fact that JPEG and other images that are displayed on the site (and this is a site with a heavy image) may contain metadata. Where was the photo taken, etc.?

The fact is that this information does not matter on this site. It will never be used. Nevertheless, it still increases throughput, as it increases the size of each image from several bytes to several kilobytes.

On a site that uses more than 2.5 TB per month, capturing several thousand images of their metadata will help reduce bandwidth usage by at least a few gigabytes per month, I think, if not more.

So, is there a way to do this in PHP? And also, for existing files, does anyone know of a good automatic removal of metadata? I know JPEG and PNG Stripper , but this is not very good ... May be useful for initial cleanup, though ...

+3
source share
7 answers

Smush.it! . API, .

. . . , .

+3

GD:

$img = imagecreatefromjpeg("myimg.jpg");
imagejpeg($img, "newimg.jpg", $quality);
imagedestroy($img);

EXIF. , , , . , , , .

+6

, .

, :

  • -?
  • http 304 ?
  • - / php-, ? ( URL http).
+5

, . , , , 2,5 . , . , , , 304 , , - amazon S3 . , .

, EXIF ​​ , GD- jpeg- imagejpeg. EXIF.

+3

, , .

, , . ; ,

. 50%, 80%, , .

, "". , , , , , . , Flickr, .

+2

, - . - .

, , , php.

0

It may be smart to do all the manipulations with images on the client side (using a java applet such as facebook), and then when the image is compressed, resized and completely devoid of unnecessary pixels and content, it can be loaded on it the optimal size, saving bandwidth server-side capabilities and performance! (due to initial development)

0
source

Source: https://habr.com/ru/post/1705251/


All Articles