Why can't I decompress an image in 8 kB in PHP?

Source: Internet
Author: User
Why can't I decompress an 8 K image in PHP and press it to the end of the 8 K image.
Who can tell me where to set the size or use other methods to solve the problem?


Reply to discussion (solution)

What to extract images ?? Clear points

I first compress all jpg images, then upload the compressed package to the server on the webpage, decompress the package while uploading it to the directory I want. The extracted image is only 8 KB in size. Many images show only half of the image above, and none of the images below are displayed.

Is the size of the uploaded image 8 K.

The image in the compressed package is still the original size. if the size of the extracted image is smaller than 8 kB, all the images will be displayed. if the size of the extracted image is greater than 8 KB, the image will be shown as 8 kB, more than one department is gray, just like this.

The image above is decompressed by PHP... Only more than 8 K is missing.

Paste your code
Maybe you can upload the compressed package to a place for download and show it to me.

$ Zip = zip_open ("/php/test/test.zip ");

If ($ zip ){
While ($ zip_entry = zip_read ($ zip )){
$ Fp = fopen ("/php/". zip_entry_name ($ zip_entry), 'w ');
If (zip_entry_open ($ zip, $ zip_entry, "r ")){
$ Buf = zip_entry_read ($ zip_entry, zip_entry_filesize ($ zip_entry ));

Fwrite ($ fp, '$ buf ');
Zip_entry_close ($ zip_entry );
Fclose ($ fp );
}
}
Zip_close ($ zip );
}

I felt it was a problem in the red part, but I went to the program and didn't find any place to control its size.
Is it set in PHP?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.