![]() There's a code snippet for getting JPEG image dimensions by getting only first few bytes of the file, but it doesn't work for PNG files, so I wrote one. It will download only the first 24 bytes instead of the whole image, and thus being much faster than getimagesize() and it will save bandwidth at the same time: #Get the ram dump image using qpst configuration code #Get the ram dump image using qpst configuration download This function returns the width and height of a JPEG image from a string, allowing the dimensions of images stored in a database to be retrieved without writing them to the disk first, or using "imagecreatefromstring" which is very slow in comparison.ĭoing this 10,000 times takes 0.43 seconds, compared with using imagecreatefromstring/imagesx/imagesy which takes around 1.52 seconds to do the same.ĭo not use this instead of getimagesize when dealing with files, getimagesize is much faster coming in at 0.15 seconds. #Get the ram dump image using qpst configuration download.#Get the ram dump image using qpst configuration code. ![]() ![]() #Get the ram dump image using qpst configuration archive. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |