M
M
My joy2014-08-28 17:09:18
PHP
My joy, 2014-08-28 17:09:18

How to find out the size of the Width Height of a swf file packed in a zip archive in php?

I know that the getimagesize function works for unpacked files, but what about the files that are in the archive as upload ?
needed to rename files on the fly, in the names of which there is a size.
type: image_200x400_1.swf image_728x60_0.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Shorokhov, 2014-09-03
@comm1x

Better not rack your brains, solve this matter by means of the operating system. Something like:

exec('unzip /www/storage/somefile.zip', $out, $status);
// Анализируем $out и $status, если распаковалось корректно, то далее проверяем через file_info
finfo_open(...)

Fileinfo will need to be installed beforehand as a php extension or again via exec()
Dimensions can be found through the same imagemagick, calling it through exec ().
About imagemagick: www.imagemagick.org
About phmagick (php wrapper for imagemagick): www.phmagick.org

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question