I have ImageMagick static installed and working with Gallery 2, however I seem to be unable to get it to work with Gallery 3 Beta 1. The ImageMagick install path is in the PATH and I also tried manually editing graphs.php and movies.php as described here;
Hmmm, I didn't realise that Windows specifically wasn't being supported. I though G3 was targeted at being platform independent rather than coding in accomodations (bloat) for any quirks related to a particular OS or web server.
What sort of Windows specific things should I look out for that might trip me up using G3 on IIS/FastCGI? Paths seem to be one of them, anything else?
I'm going to be really disappointed if I can't use G3 on Windows. I have over 3 years and 4000 photos invested in G2, so don't want to be left stranded there. I guess that decision was made as all the devs are using *nix based systems?
nivekiam
Joined: 2002-12-10
Posts: 16503
Posted: Wed, 2009-09-30 22:11
Quote:
I though G3 was targeted at being platform independent rather than coding in accomodations (bloat) for any quirks related to a particular OS or web server.
Just the opposite. The quirks and bloat is staying out by focusing on a single platform. EVERY TIME you make something cross platform your code base is larger than if you focused on a smaller set.
Quote:
I guess that decision was made as all the devs are using *nix based systems?
Yes. If a dedicated Windows, PHP developer wanted to come on board, they'd be welcome with open arms. They'd have to be able to dedicate 100s of hours per year to coding and support, but they'd be very welcome. Windows is not what we know for support and know what the devs know for programming so we've given more focus to the project unlike G2 which was the "every thing under the sun" application. Which made if very hard to code for and learn and why it took so long to get even a fraction of the traction we have for themes and modules happening in G3 already.
Linux
Apache 2.2
PHP 5.2.3 or newer
MySQL 5.x or newer
G2 isn't going away. G3 is not going to satisfy all of the G2 users.
I've ran G3 on Windows using XAMPP (Apache, MySQL, PHP) without major issue. But I never installed IM and configured that.
Take a look at /modules/gallery/helpers/graphics.php
There you'll see that it's using a Linux specific command to find the binaries, which is probably failing on Windows. You'll need to at least modify the line that contains exec("which convert") to make that work on Windows.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
floridave
Joined: 2003-12-22
Posts: 22892
Posted: Wed, 2009-09-30 23:50
Quote:
I have over 3 years and 4000 photos invested in G2, so don't want to be left stranded there.
G2 is not going away. We are still supporting it. And it might take some time to have all the features in G3 that G2 currently has.
Quote:
I guess that decision was made as all the devs are using *nix based systems?
Not really. The decision was made because of for many reasons some of them:
~ We've decided that the most common platform, available to all (even if it's not what you're using now, it's something that you could be using easily) is Apache 2, PHP 5, and MySQL 5.
~ More than 80% of the hosts and users have the option to move to a *nix based OS.
~ Apache offers things that other webservers can't offer.
~ Little or no development resources to develop on other platforms.
~ Little or no support resources to support and test other platforms.
But this is open source, so if it's of enough interest to the community I'm sure you'll see some support emerging.
Thanks for the feedback guys. I can understand what you are saying regarding platform independence. I always had the thought that using PHP functions would free you of any ties to the underlying operating system or web server, obviously not though. I can definately offer assistance on the Windows/IIS side of things, but I struggle to spell PHP let alone code it.
Anyway, I was able to get around the issue I reported by going to admin -> settings -> advanced and manually setting the values for graphics_toolkit_path and graphics_toolkit. Works a treat. Just need to figure out why my G2 import stalls at picture 1906 of 3880 each time.
Cheers
nivekiam
Joined: 2002-12-10
Posts: 16503
Posted: Thu, 2009-10-01 15:18
There is probably something wrong with that particular image that is causing your image toolkit to hang up on it.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
psychoph
Joined: 2009-11-15
Posts: 23
Posted: Sun, 2009-11-15 22:42
Windows uses the where command to locate the information. I would also be recommended if you use the output variable in the exec call rather than assigning it to $path. Mainly because at least in windows you can get multiple lines returned. I changed line line 388 of graphics.php to the following:
exec("where convert", $paths);
$path = $paths[0];
it was
$path = exec("which convert");
It works on my Windows 7 install only because ImageMagick is the first in my PATH variable. there is a convert.exe in the Windows/System32 directory which will also come up when using the where command in Windows.
psychoph
Joined: 2009-11-15
Posts: 23
Posted: Sun, 2009-11-15 22:46
in movie.php I just changed which to where on line 163.
psychoph
Joined: 2009-11-15
Posts: 23
Posted: Sun, 2009-11-15 23:08
A true solution to the problem would be to use the PHP_OS in an if statement
In the GraphicsMagick section it would be similar
if(stristr(PHP_OS, 'win')){
exec("where gm", $paths);
$path = $paths[0];
} else {
$path = exec("which gm");
}
This still isn't perfect since it assumes that the first location found is the ImageMagick directory and the correct one. I found ImageMagick does not uninstall previous versions so this could be a problem as well if the ImageMagick directory is not first int he path.
floridave
Joined: 2003-12-22
Posts: 22892
Posted: Mon, 2009-11-16 03:30
psychoph,
Thanks for getting back with a solution for other windows users.
I don't think the team will go for specific PHP_OS checks, ( where do we draw the line ? ) but thanks for the suggestion.
Psychoph, seems like you have a solution many of us windows users are looking for. How to get ImageMagick working with G3. I don't know if it's me , but for some reason I can't find files graphics.php and movie.php anywhere on my PC. I have G3 installed, I looked through all the folders, made an extensive search and nothing. I'd like to modify the lines you suggested to make it work, but I don't have those files.
Would you advise please?
Tom.
Martan
Joined: 2003-06-05
Posts: 36
Posted: Mon, 2009-11-16 07:46
Never mind, it was me , I found them, my apology....
psychoph
Joined: 2009-11-15
Posts: 23
Posted: Thu, 2010-01-21 03:21
I can sort of understand that, except the team is forcing OS specific support only for an os with the use of which. Alternatives I can think of would be:
1. Create an administrator configurable variable that point to the commands to be used, defaulting to linux commands, rather than hard coding.
2. Windows system administrators create an alias to where with the name which so that the linux which command is found probably a .bat that just calls where i will have to research that
3. Use the graphics toolkit directory variable to find the files if they are not found by which.
I guess as far as I can think there are a lot of options to code to OS differences through variables that don't sacrifice speed in the process. At the moment I don't know how to create server variables in gallery 3 but there is already a set of 20-30 in the advance settings seems simple enough to add which command, or use the graphics tool kit directory.
I personally will probably just stick with replacing which with where in my code and deal with collisions with git if the core team changes the code.
Posts: 22892
We are at beta3 now. See if using a experimental version works:
FAQ: How do I upgrade?
Windows is not a supported platform for G3.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 60
Sorry Dave, I did mean Beta 3.
Hmmm, I didn't realise that Windows specifically wasn't being supported. I though G3 was targeted at being platform independent rather than coding in accomodations (bloat) for any quirks related to a particular OS or web server.
What sort of Windows specific things should I look out for that might trip me up using G3 on IIS/FastCGI? Paths seem to be one of them, anything else?
I'm going to be really disappointed if I can't use G3 on Windows. I have over 3 years and 4000 photos invested in G2, so don't want to be left stranded there. I guess that decision was made as all the devs are using *nix based systems?
Posts: 16503
Just the opposite. The quirks and bloat is staying out by focusing on a single platform. EVERY TIME you make something cross platform your code base is larger than if you focused on a smaller set.
Yes. If a dedicated Windows, PHP developer wanted to come on board, they'd be welcome with open arms. They'd have to be able to dedicate 100s of hours per year to coding and support, but they'd be very welcome. Windows is not what we know for support and know what the devs know for programming so we've given more focus to the project unlike G2 which was the "every thing under the sun" application. Which made if very hard to code for and learn and why it took so long to get even a fraction of the traction we have for themes and modules happening in G3 already.
Linux
Apache 2.2
PHP 5.2.3 or newer
MySQL 5.x or newer
G2 isn't going away. G3 is not going to satisfy all of the G2 users.
I've ran G3 on Windows using XAMPP (Apache, MySQL, PHP) without major issue. But I never installed IM and configured that.
Take a look at /modules/gallery/helpers/graphics.php
There you'll see that it's using a Linux specific command to find the binaries, which is probably failing on Windows. You'll need to at least modify the line that contains exec("which convert") to make that work on Windows.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
Posts: 22892
G2 is not going away. We are still supporting it. And it might take some time to have all the features in G3 that G2 currently has.
Not really. The decision was made because of for many reasons some of them:
~ We've decided that the most common platform, available to all (even if it's not what you're using now, it's something that you could be using easily) is Apache 2, PHP 5, and MySQL 5.
~ More than 80% of the hosts and users have the option to move to a *nix based OS.
~ Apache offers things that other webservers can't offer.
~ Little or no development resources to develop on other platforms.
~ Little or no support resources to support and test other platforms.
But this is open source, so if it's of enough interest to the community I'm sure you'll see some support emerging.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 60
Thanks for the feedback guys. I can understand what you are saying regarding platform independence. I always had the thought that using PHP functions would free you of any ties to the underlying operating system or web server, obviously not though. I can definately offer assistance on the Windows/IIS side of things, but I struggle to spell PHP let alone code it.
Anyway, I was able to get around the issue I reported by going to admin -> settings -> advanced and manually setting the values for graphics_toolkit_path and graphics_toolkit. Works a treat. Just need to figure out why my G2 import stalls at picture 1906 of 3880 each time.
Cheers
Posts: 16503
There is probably something wrong with that particular image that is causing your image toolkit to hang up on it.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
Posts: 23
Windows uses the where command to locate the information. I would also be recommended if you use the output variable in the exec call rather than assigning it to $path. Mainly because at least in windows you can get multiple lines returned. I changed line line 388 of graphics.php to the following:
exec("where convert", $paths);
$path = $paths[0];
it was
$path = exec("which convert");
It works on my Windows 7 install only because ImageMagick is the first in my PATH variable. there is a convert.exe in the Windows/System32 directory which will also come up when using the where command in Windows.
Posts: 23
in movie.php I just changed which to where on line 163.
Posts: 23
A true solution to the problem would be to use the PHP_OS in an if statement
if(stristr(PHP_OS, 'win')){
exec("where convert", $paths);
$path = $paths[0];
} else {
$path = exec("which convert");
}
In the GraphicsMagick section it would be similar
if(stristr(PHP_OS, 'win')){
exec("where gm", $paths);
$path = $paths[0];
} else {
$path = exec("which gm");
}
This still isn't perfect since it assumes that the first location found is the ImageMagick directory and the correct one. I found ImageMagick does not uninstall previous versions so this could be a problem as well if the ImageMagick directory is not first int he path.
Posts: 22892
psychoph,
Thanks for getting back with a solution for other windows users.
I don't think the team will go for specific PHP_OS checks, ( where do we draw the line ? ) but thanks for the suggestion.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 36
Psychoph, seems like you have a solution many of us windows users are looking for. How to get ImageMagick working with G3. I don't know if it's me , but for some reason I can't find files graphics.php and movie.php anywhere on my PC. I have G3 installed, I looked through all the folders, made an extensive search and nothing. I'd like to modify the lines you suggested to make it work, but I don't have those files.
Would you advise please?
Tom.
Posts: 36
Never mind, it was me , I found them, my apology....
Posts: 23
I can sort of understand that, except the team is forcing OS specific support only for an os with the use of which. Alternatives I can think of would be:
1. Create an administrator configurable variable that point to the commands to be used, defaulting to linux commands, rather than hard coding.
2. Windows system administrators create an alias to where with the name which so that the linux which command is found probably a .bat that just calls where i will have to research that
3. Use the graphics toolkit directory variable to find the files if they are not found by which.
I guess as far as I can think there are a lot of options to code to OS differences through variables that don't sacrifice speed in the process. At the moment I don't know how to create server variables in gallery 3 but there is already a set of 20-30 in the advance settings seems simple enough to add which command, or use the graphics tool kit directory.
I personally will probably just stick with replacing which with where in my code and deal with collisions with git if the core team changes the code.