I like to open a Windows bitmap file within php.
I found some piece of code (imagecreatefrombmp), that converts a bmp to png.
But that code is in plain php and to slow.
My images have a size around 1000x2000 pixels.
gdlib doesn't open bmp files.
IMagick to complicated to compile and i don't find windows binaries that work with my php.
Additional i like to open that bmp from a string.
it is streamed from a db.
I also need to do some rotations (0, 90, 180, 270) and some cropping.
Finally i like to save it to tiff or png file (or string).
But primary problem, how to open a bmp file?
plattform:
php 5.2 (vc6,ts) on Windows Cli and Apache 2.2 Module
zend framework 1.10
You can find precompiled gmagick PHP extension for Windows at valokuva site. The file is named php_gmagick_ts.dll.
The trick is that these are built using VC9 compiler so you will need VC9 version of Apache and PHP as well. If you plan to install PHP as a module, you will need a thread safe (ts) version of gmagick and PHP. You can get Apache built using VC9 from apachelounge, file named httpd-2.2.14-win32-x86-ssl.zip and PHP from PHP web site, file named php-5.3.1-Win32-VC9-x86.msi
gmagick code samples are available in the PHP documentation or in great tutorial at Zend DevZone.
To see all links for this answer go to http://www.google.com/notebook/public/11284522948259357138/BDQo5QwoQqbC67p4i
Enjoy!
Related
I've followed this tutorial to install and support PHP-5.6 at my ISPConfig3 server: https://www.howtoforge.com/tutorial/how-to-install-php-5-6-on-ubuntu-16-04/.
The installation is up and running, now I want to change the php-gd library version. PHP info actually reports:
GD Support enabled
GD Version bundled (2.1.0 compatible)
I need to use the following version:
GD Support enabled
GD headers Version 2.2.3
GD library Version 2.2.3
Why do i need to upgrade?
I'm facing problems when cropping images, but is only on this server. I've a similar server with PHP-5.6, without fpm, that is working fine. I realized the difference in versions after compare the phpinfo() reports from both servers
Expected Behavior
User uploads an image. The image can have any dimension. (eg: 1920x1080)
The script resizes the image. (eg: from 1920px to 1200px)
The resized image maintain it's original aspect ratio and should not be cropped.
See: http://imgur.com/MkMVg6x
The problem
User uploads an image. The image can have any dimension. (eg: 1920x1080)
The script SHOULD resize the image. (eg: from 1920px to 120px)
The final image was cropped erroneously :(
See: http://imgur.com/a/wT0Rh
Since i'm using php-fpm, how can i upgrade my GD library version?
After long hours digging, I finally found the problem, and as i expected, it's not related to GD library itself. It's related to phpThumb and imagemagick libraries.
I am trying to convert pdf file into jpeg image format using imagemagik crop and ghostscript.
I research a lot, but not getting any solution got so many links but my system compatiblity might be an issue.
My System is Win 7
PHP v 5.3.13
Apache v 2.3.33
wampserver2.2e-php5.3.13-httpd2.2.22-mysql5.5.24-32b
I am not getting any proper link where i can find out dll file and make such changes in .dll file etc.
If all you want is a JPEG then you can use Ghostscript directly to produce it. I can't see any reason why you would want to change a DLL, which realistically you can only do by changing and recompiling the source.
Eg:
http://stackoverflow.com/questions/13812998/ghostscript-ps-to-jpg-output-without-white-space
I would like to use iMagick with my PHP web page, but I can't find where to download an official PHP extension for Windows compiled with code http://pecl.php.net/package/imagick
I found some links on the web like :
http://valokuva.org/outside-blog-content/imagick-windows-builds/php53/imagick-2.3.0-dev/
http://dev.freshsite.pl/php-extensions/imagick.html
But some PHP extensions are very old and makes Apache crash, others are working.
And how can I trust the DLL code inside?
Is there a trusted web site where I could donwload iMagick PHP extension compiled with VC6 and VC9?
Try to have a look here usually these extensions work quite well.
For production server is better to compile it from source code using PECL, Visual Studio or Windows SDK
Imagemagick source codes on Pecl
How to build php extension on Windows
I also spent hours trying to install imagick on windows 7. Only this solution worked https://mlocati.github.io/articles/php-windows-imagick.html
It tells exact versions that will work with my system. Please note that usually windows are 64 bits but php on xampp has x84
is it possible to check the php imagick extension for ghostscript support?
for example if it is turned on / off, the ghostscript version used, etc.
which possibilities are there to get additional ghostscript / pdf details?
the only thing i've found so far is this (version of imagick lib itself):
http://php.net/manual/en/imagick.getversion.php
ps: no system calls are allowed (e.g. exec) from within php
I don't know much about imagick, but some things about imagemagick. My guess is that by reading this answer related to imagemagick could help you with imagick as well:
convert -list delegate | grep -Ei '(PDF|PS|EPS)'
(convert is one of the CLI utilities which are part of imagemagick.)
can anybody recommend a script which creates Thumbnails with imagemagick? All I could found were too old. It has to run with php5 and on a newer linux server.
It is important, that it uses imagemagick and not GD Lib. I already know timthumb, but it uses GD lib.