How can I scale down an image to obtain its binary value? Mongodb database Image binary storage
I am using a mongodb database to store images in binary format. The problem is that I have obtained the binary data. how can I scale it down?
Reply to discussion (solution)
$ Im = imagecreatefromstring ('obtained image data ');
There will be nothing special next.
Can imagecreatefromstring () really recognize binary data? Let me try. thank you!
$ Im = imagecreatefromstring ('obtained image data ');
Next, there is nothing special about it. how can we convert the image into a binary format?
This is a bit strange. Aren't you "storing images in binary format? Why?
This is a bit strange. Aren't you "storing images in binary format? Why? This was previously done by a Great God. you can't understand it... What I want to do is to narrow down the binary image and convert it to binary without damaging the original structure... Can you tell me how to implement it? Thank you.
... Image operations
Imagegif ($ im, 'filename ');
$ S = file_get_contents ('filename ');
Or
... Image operations
Ob_start ();
Imagegif ($ im );
$ S = ob_get_clean ();