Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Support thread for the Image Magic contribution


tomjmul

Recommended Posts

  • Replies 1.3k
  • Created
  • Last Reply

Top Posters In This Topic

Does anyone know how to get ImageMagic to work with SEO URLS... All images are displaying fine, but the product page image is not showing the right dimensions with SEO URLs turned on.

 

Also a small bug, on the product page, if the sidebar (new items for example) is showing the same product, the image in here is also the same size as the product image!

 

Thanks for any help.

 

J

Link to comment
Share on other sites

Hello

 

Image Magic was working great, exactly the results expected...but my website host asked me to remove it as it is taking too much CPU process (more than 90% of the 3.0Ghz server, OVH hosted).

 

I wonder if somebody had the same problem.

 

Patrice

Link to comment
Share on other sites

Hello

 

Image Magic was working great, exactly the results expected...but my website host asked me to remove it as it is taking too much CPU process (more than 90% of the 3.0Ghz server, OVH hosted).

 

I wonder if somebody had the same problem.

 

Patrice

Link to comment
Share on other sites

I have installed the contribution and all is working fine but I am concerned with the permision settings of the thumbnail directory.

 

Can some who has been using the contrib for a while instruct me on how to protect my site from malicious users exploiting the 777 access granted to my thumbnail directory? Is there a way I can still use the contrib but limit write access to the owner?

 

Thanks,

Mark

Link to comment
Share on other sites

I would like to improve imagemagic by adding a php unsharp mask to it. Here is the code, I just don't know where it must be installed in imagemagic.functions.php in order to pass the $img variable as a truecolor image: I don't underdtand what a truecolor image is, or how to create one from an image URL.

 

If somebody could help how to integrate this function, I think all sites could display crisper resized images (I used to resharpen all my thumbnail before I switched to OSCOM, and the qulity was much better than what imagemagic produces. I'm sure it's not a lot of work for somedy who know how to get a treucolor image :-)

 

here is the code: (this is the best algorithm I found)

 

  function UnsharpMask($img, $amount, $radius, $threshold)????{ 

//////////////////////////////////////////////////////////////////////////////////////////////// 
//// 
////??????????????????p h p U n s h a r p M a s k 
//// 
////????Unsharp mask algorithm by Torstein H?nsi 2003. 
////?????????????thoensi_at_netcom_dot_no. 
////???????????????Please leave this notice. 
//// 
/////////////////////////////////////////////////////////////////////////////////////////////// 


????// $img is an image that is already created within php using 
????// imgcreatetruecolor. No url! $img must be a truecolor image. 

????// Attempt to calibrate the parameters to Photoshop: 
????if ($amount > 500)????$amount = 500; 
????$amount = $amount * 0.016; 
????if ($radius > 50)????$radius = 50; 
????$radius = $radius * 2; 
????if ($threshold > 255)????$threshold = 255; 
???? 
????$radius = abs(round($radius)); ????// Only integers make sense. 
????if ($radius == 0) { 
????????return $img; imagedestroy($img); break;????????} 
????$w = imagesx($img); $h = imagesy($img); 
????$imgCanvas = imagecreatetruecolor($w, $h); 
????$imgCanvas2 = imagecreatetruecolor($w, $h); 
????$imgBlur = imagecreatetruecolor($w, $h); 
????$imgBlur2 = imagecreatetruecolor($w, $h); 
????imagecopy ($imgCanvas, $img, 0, 0, 0, 0, $w, $h); 
????imagecopy ($imgCanvas2, $img, 0, 0, 0, 0, $w, $h); 
???? 

????// Gaussian blur matrix: 
????//???????????????????????? 
????//????1????2????1???????? 
????//????2????4????2???????? 
????//????1????2????1???????? 
????//???????????????????????? 
????////////////////////////////////////////////////// 

????// Move copies of the image around one pixel at the time and merge them with weight 
????// according to the matrix. The same matrix is simply repeated for higher radii. 
????for ($i = 0; $i < $radius; $i++)????{ 
????????imagecopy ($imgBlur, $imgCanvas, 0, 0, 1, 1, $w - 1, $h - 1); // up left 
????????imagecopymerge ($imgBlur, $imgCanvas, 1, 1, 0, 0, $w, $h, 50); // down right 
????????imagecopymerge ($imgBlur, $imgCanvas, 0, 1, 1, 0, $w - 1, $h, 33.33333); // down left 
????????imagecopymerge ($imgBlur, $imgCanvas, 1, 0, 0, 1, $w, $h - 1, 25); // up right 
????????imagecopymerge ($imgBlur, $imgCanvas, 0, 0, 1, 0, $w - 1, $h, 33.33333); // left 
????????imagecopymerge ($imgBlur, $imgCanvas, 1, 0, 0, 0, $w, $h, 25); // right 
????????imagecopymerge ($imgBlur, $imgCanvas, 0, 0, 0, 1, $w, $h - 1, 20 ); // up 
????????imagecopymerge ($imgBlur, $imgCanvas, 0, 1, 0, 0, $w, $h, 16.666667); // down 
????????imagecopymerge ($imgBlur, $imgCanvas, 0, 0, 0, 0, $w, $h, 50); // center 
????????imagecopy ($imgCanvas, $imgBlur, 0, 0, 0, 0, $w, $h); 

????????// During the loop above the blurred copy darkens, possibly due to a roundoff 
????????// error. Therefore the sharp picture has to go through the same loop to 
????????// produce a similar image for comparison. This is not a good thing, as processing 
????????// time increases heavily. 
????????imagecopy ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h); 
????????imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 50); 
????????imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 33.33333); 
????????imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 25); 
????????imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 33.33333); 
????????imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 25); 
????????imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 20 ); 
????????imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 16.666667); 
????????imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 50); 
????????imagecopy ($imgCanvas2, $imgBlur2, 0, 0, 0, 0, $w, $h); 
???????? 
????????} 

????// Calculate the difference between the blurred pixels and the original 
????// and set the pixels 
????for ($x = 0; $x < $w; $x++)????{ // each row 
????????for ($y = 0; $y < $h; $y++)????{ // each pixel 
???????????????? 
????????????$rgbOrig = ImageColorAt($imgCanvas2, $x, $y); 
????????????$rOrig = (($rgbOrig >> 16) & 0xFF); 
????????????$gOrig = (($rgbOrig >> 8) & 0xFF); 
????????????$bOrig = ($rgbOrig & 0xFF); 
???????????? 
????????????$rgbBlur = ImageColorAt($imgCanvas, $x, $y); 
???????????? 
????????????$rBlur = (($rgbBlur >> 16) & 0xFF); 
????????????$gBlur = (($rgbBlur >> 8) & 0xFF); 
????????????$bBlur = ($rgbBlur & 0xFF); 
???????????? 
????????????// When the masked pixels differ less from the original 
????????????// than the threshold specifies, they are set to their original value. 
????????????$rNew = (abs($rOrig - $rBlur) >= $threshold) 
????????????????? max(0, min(255, ($amount * ($rOrig - $rBlur)) + $rOrig)) 
????????????????: $rOrig; 
????????????$gNew = (abs($gOrig - $gBlur) >= $threshold) 
????????????????? max(0, min(255, ($amount * ($gOrig - $gBlur)) + $gOrig)) 
????????????????: $gOrig; 
????????????$bNew = (abs($bOrig - $bBlur) >= $threshold) 
????????????????? max(0, min(255, ($amount * ($bOrig - $bBlur)) + $bOrig)) 
????????????????: $bOrig; 
???????????? 
???????????? 
???????????????????????? 
????????????if (($rOrig != $rNew) || ($gOrig != $gNew) || ($bOrig != $bNew)) { 
????????????????????$pixCol = ImageColorAllocate($img, $rNew, $gNew, $bNew); 
????????????????????ImageSetPixel($img, $x, $y, $pixCol); 
????????????????} 
} 
????????} 

????imagedestroy($imgCanvas); 
????imagedestroy($imgCanvas2); 
????imagedestroy($imgBlur); 
????imagedestroy($imgBlur2); 
???? 
????return $img; 

????}

 

Thnk you for your help!

Link to comment
Share on other sites

Hi! I installed Image Magic contribution, and everything works fine.

 

I got only one problem: I also installed "Open Featured Set" contribution, that displays the featured products on many pages... as the product_info page.

 

Everywhere the product_info image is called on this page, the images are all the same dimension...

 

I think it is related to this code:

 

  if (strstr($_SERVER['PHP_SELF'],"product_info.php")) {

	if (isset($product_info['products_image']) 
			   && $src == DIR_WS_IMAGES . $product_info['products_image']
			   && $product_info[products_id]==$_GET['products_id'])  {   //final check just to make sure that we don't interfere with other contribs
		$width = PRODUCT_INFO_IMAGE_WIDTH == 0?'':PRODUCT_INFO_IMAGE_WIDTH;
		$height = PRODUCT_INFO_IMAGE_HEIGHT == 0?'':PRODUCT_INFO_IMAGE_HEIGHT;
		$product_info_image=true;
		$page="prod_info"; 
	}
 }

 

Any solution to this problem?

Link to comment
Share on other sites

hi, i use morepics contrib which allows multiple pictures to display on your page. but i have a problem. if i replace the popup_image.php with the one more pics includes, morepicsworks fine. but i cant do any watermarking on the popup images.. so basically id like to add the variables i need to control the additional images to the imagemajic php file.. but im kinda lost..

 

here is the popup php file morepics includes.. maybe you can help me add this to your imagemagic.php ? im sure alot of peeople would appreciate it.

 

<?php
/*
 $Id: popup_image.php,v MoPics 6 2003/06/05 23:26:23 Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
 Updated by John Wood - www.z-is.net
*/

 require('includes/application_top.php');

 $navigation->remove_current_page();

 $products_query = tep_db_query("select pd.products_name, p.products_image from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and pd.language_id = '" . (int)$languages_id . "'");
 $products = tep_db_fetch_array($products_query);
// BOF: More Pics 6
$PID = $HTTP_GET_VARS['pID'];
$invis = $HTTP_GET_VARS['invis'];
$result = mysql_query("select * from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['pID'] . "'");
// EOF: More Pics 6
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo $products['products_name']; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<script language="javascript"><!--
var i=0;
function resize() {
<?php // BOF: More Pics 6 ?>
 if (document.layers) i=40;
 if (document.images[0]) window.resizeTo(document.images[0].width +30, document.images[0].height+115-i);
<?php // EOF: More Pics 6 ?>
 self.focus();
}
//--></script>
<?php // BOF: More Pics 6 ?>
<meta http-equiv="Page-Enter" content="blendTrans(Duration=0.5)">
<meta http-equiv="Page-Exit" content="blendTrans(Duration=0.5)">
<?php // EOF: More Pics 6 ?>
</head>
<body onLoad="resize();">
<?php // BOF: More Pics 6 ?>
<table border="0" cellpadding="0" cellspacing="0" align="center">
  <?php // Lets find the last available image !
$image = tep_db_fetch_array($result);
if ($image['products_subimage6'] != ''){	   
$last = '6';
}elseif ($image['products_subimage5'] != ''){
$last = '5';
}elseif ($image['products_subimage4'] != ''){
$last = '4';
}elseif ($image['products_subimage3'] != ''){	   
$last = '3';
}elseif ($image['products_subimage2'] != ''){	   
$last = '2';
}elseif ($image['products_subimage1'] != ''){	   
$last = '1';
}elseif ($image['products_image'] != ''){	   
$last = '0';
}
$next = $invis + '1';
$back = $invis - '1';
?>
<?php
if (($invis == '0') || ($invis == '')){
$insert = $image['products_image'];
} else  {
$insert = $image['products_subimage' . $invis. ''];
}

$img = DIR_WS_IMAGES . $insert;
echo '<tr><td align="center"><img src="' . $img . '"></td>';
?>		</tr>
<tr>
<td height="0" align="center"></td></tr>
<tr>
<td height="20" align="center">
<?php
if (($back != '-1') || ($next <= $last)) {
 echo '<hr color="#666666" size="3">';
}
if ($back != '-1'){
echo '<a href="'.tep_href_link('popup_image.php','pID='.$PID.'&invis='.$back).'">' . tep_image(DIR_WS_IMAGES.'left.gif', 'previous', '', '', 'border="0"') . '</a>  ';
}
if ($next <= $last){
echo '<a href="'.tep_href_link('popup_image.php','pID='.$PID.'&invis='. $next).'">' . tep_image(DIR_WS_IMAGES.'right.gif', 'next', '', '', 'border="0"') . '</a>';
}
echo '</td></tr>';
?>
</table>
<?php // EOF: More Pics 6 ?>
</body>
</html>
<?php require('includes/application_bottom.php'); ?>

Link to comment
Share on other sites

i didnt even realize how imagemagic worked..

i figured it out.. i just took the html tag out of the popup and used the tep function to display the image and it worked. awesome!. heres the code for anyone who wants it..

 

replace

[/code]

echo '<tr><td align="center"><img src="' . $img . '"></td>';

[/code]

in the popup_image.php that comes with more pics with this

echo '<tr><td align="center">' .tep_image(DIR_WS_IMAGES . $insert) . '</td>';

 

since nobody seemed to have the answer for me and i figured out myself i will also post this in the morepics contrib to help anyone out in the future who might not see this post.

Link to comment
Share on other sites

1 question.. why is image maic so quick to process the product info pages pages, but the popups even if watermarking is turned off seems to take on average 8-10 seconds? thats if its not cached ofcourse

Link to comment
Share on other sites

Hey guys, I have a similar problem that most of you are having. On my store, after installing this contrib, I no longer see my images though when I right click them to view it, I notice that it is going through the imagemagic.php. When I open this page, I get the following errors.

 

Warning: mkdir(thumbnails): Permission denied in /home/medidcaa/public_html/catalog/imagemagic.php on line 374

 

Warning: Cannot modify header information - headers already sent by (output started at /home/medidcaa/public_html/catalog/imagemagic.php:374) in /home/medidcaa/public_html/catalog/imagemagic.php on line 487

 

Warning: Cannot modify header information - headers already sent by (output started at /home/medidcaa/public_html/catalog/imagemagic.php:374) in /home/medidcaa/public_html/catalog/imagemagic.php on line 488

 

Warning: Cannot modify header information - headers already sent by (output started at /home/medidcaa/public_html/catalog/imagemagic.php:374) in /home/medidcaa/public_html/catalog/imagemagic.php on line 489

 

Warning: Cannot modify header information - headers already sent by (output started at /home/medidcaa/public_html/catalog/imagemagic.php:374) in /home/medidcaa/public_html/catalog/imagemagic.php on line 490

 

Warning: Cannot modify header information - headers already sent by (output started at /home/medidcaa/public_html/catalog/imagemagic.php:374) in /home/medidcaa/public_html/catalog/imagemagic.php on line 491

 

Warning: Cannot modify header information - headers already sent by (output started at /home/medidcaa/public_html/catalog/imagemagic.php:374) in /home/medidcaa/public_html/catalog/imagemagic.php on line 492

????

 

Any ideas?

Link to comment
Share on other sites

those headers already sent may happen when you have (invisible) return carriage characters after the last ?> at the very end of an include file

 

check in an HTML editor that puts line numbers so you can see them. I pulled my hair for 3 days before i figured out

Link to comment
Share on other sites

Hey guys, I have a similar problem that most of you are having. On my store, after installing this contrib, I no longer see my images though when I right click them to view it, I notice that it is going through the imagemagic.php. When I open this page, I get the following errors.

 

Warning: mkdir(thumbnails): Permission denied in /home/medidcaa/public_html/catalog/imagemagic.php on line 374

 

There's your problem right there. Check the permissions in your cache directory. The module is trying to create a folder to put your thumbnails in, and it's not able to do that, so the whole process bombs.

 

I've found some bugs in this contribution, and I'd like to submit them.

 

For some reason, my PHP setup must be more strict than others, because I got a lot of errors when I first tried to get the file to work. The first one was in catalog/imagemagic.php

 

The line that says:

 

	  if ($row['cfgKey'] != "LAST_HASH") $config_values.=$row['cfgKey'].'='.$row['cfgValue']; //to be fed to hashing function

 

I was getting an error saying $config_values does not exist. I guess newer versions of PHP don't like it when you try to append data to a variable that doesn't exist. I added the following code to line 24 and got around this bug.

 

// added this to get around PHP errors
$config_values = "";

 

The next bug I encoutered was just a typo, somewhere around line 400:

 

if (file !='' && file_exists($file))
{

 

PHP thinks it's trying to access a constant called file, which doesn't exist so it throws an error. The line should look like this:

 

	if (!empty($file) && file_exists($file)) {

 

And the last bug I've found (so far) is that $page_prefix is never initialized as a variable UNLESS you're looking at the product info page or the popup. So it causes an error around line 160:

 

// If caching is switched on return the filename to check under and create the directory if it does not exist
if ($tn_server_cache) $filename = modify_tn_path($_GET['img'] .'.thumb_'.$page_prefix.$_GET['w'].'x'.$_GET['h'].'_'.$append_hash.'.'.$extension, false);

 

So if you're viewing the store in the category view, the thumbnails aren't created (because $page_prefix isnt' initialized on line 50-60:

 

// Get the type of thumbnail we are dealing with
if ( $_GET['w']== SMALL_IMAGE_WIDTH || $_GET['h'] == SMALL_IMAGE_HEIGHT) $thumbnail_size=1;
elseif ($_GET['w'] == HEADING_IMAGE_WIDTH || $_GET['h'] == HEADING_IMAGE_HEIGHT) $thumbnail_size=2;
elseif ($_GET['w'] == SUBCATEGORY_IMAGE_WIDTH || $_GET['h'] == SUBCATEGORY_IMAGE_HEIGHT) $thumbnail_size=3;
if ($_GET['page'] == "prod_info") {
  $thumbnail_size=4;
  $page_prefix = $page ."prod_info_";
}
if ($_GET['page'] == "popup") {
  $thumbnail_size=5;
  $page_prefix = $page ."prod_info_";
}

 

Fix this easily by declaring the variable BEFORE the code shown above:

 

// set $page_prefix so at least images work if $page isn't specified
$page_prefix = "";

 

And that's it. Any chances these will get put into a updated version of the contribution? A couple words about my server environment:

 

Windows 2003 Server running IIS 6.0 and PHP Version 4.4.1

 

Send me a PM if you have any questions (whoever heads up the development of this contribution).

Link to comment
Share on other sites

I have Image Magic working fine until I go to checkout. The what's new doesn't work on checkout when it goes to https. I tried installing the image magic files in the https directory, and the size went to normal but none of the images come up.

 

www.perfectracing.com/catalog

 

Thanks

Link to comment
Share on other sites

- I read and followed all installation instructions using image_magic1_13_1_2_3.zip.

- I had problem with the admin not showing the Image Magic Master Switch, thought that was my problem as it just didn't work at all.

- Followed instructions, restored back to original and tried again this time using image_magic1_13.zip.

- Image Magic Master Switch came on this time. Every thing in the admin seemed to work so I turned on the Master Switch.

- Images disappeared, began reading the posts. Realized I had no thumbnail folder created, so I manually made one in the proper root directory.

- Thumbnail folder created with 777 permisions inside catalog root directory.

- An images directory is being created in the thumbnail directory where the actual created thumbnails are being stored.

- Images are being created in the catalog/thumbnail/images directory and images are renamed.

- There are links to the thumbnail images as such: http://www.whatever.com/catalog/imagemagic...=66&h=100&page=

- Actual images names are changed in this fashion: bird_feeder.jpg.thumb_66x100_253f5afa63449d7093b66265bc82523d.jpg

- SAFE MODE is OFF

- DIR_FS_CATALOG path set correctly in configure.php, with trailing slash.

- Thumbnail server caching turned off and on.

- Error reporting turned off and in PHP.ini as follows: error_reporting = E_ALL & ~E_NOTICE.

- GD Support enabled

- GD Version bundled (2.0.28 compatible)

- FreeType Support enabled

- FreeType Linkage with freetype

- GIF Read Support enabled

- GIF Create Support enabled

- JPG Support enabled

- PNG Support enabled

- WBMP Support enabled

- XBM Support enabled

- Server OS: Linux 2.6.9-22.0.2.ELsmp

- Database: MySQL 4.1.18-standard

- PHP Version 4.3.9

- osCommerce 2.2-MS2

- HTTP Server: Apache

- The text watermark is working as I've manually viewed these thumbs created.

- The PNG watermark isn't. (Which I don't care about at all for the moment.)

- I've checked all 29 pages of posts as asked before posting, and have seen a couple of simular and tried this and that but nothing has worked.

- I signed up and waited for days and never received and email.

- I liked this because of it's premise of how it works on existing images in folders and still saves load time. Originally I kept skipping over it because I thought it was for Image Magik. The only reason I knew of Image Magik was I built my mother a site and she kept uploading 2-8 meg images, Load time was terrible espaecially for dial up. I had to resize them and make them conform to the sites html and diplay boundries and for load times. I didn't use Image Magik from the server, I used the GD library, instead of folders I used a mysql database because her site is so small.

- No product images will load on the pages, even though they are created in the images directory inside the thumbnails directory

- I checked permissions on the thumbnails directory and they were drwxrwxrwx or 777 and owned by my account.

- I checked permissions on the images directory inside the thumbnails directory and they were drwx-xr-xr or 755 and owned by apache.

- I checked permissions on the images and they were -rw-r-r or 644 and owned by apache.

 

What should I do now? Can someone help me or am I on my own here?

 

I like all the concepts, but have no idea as to what the problem is.

I signed up again to post this and waited two days and recieved no email.

So I had to sign up again. This time it obviously worked.

I hope Tom is around somewhere, seems he can fix any problem.

 

Thanks....

Link to comment
Share on other sites

Hello again,

I installed more pics and have a slight problem. Image Magic is watermarking the close button in my popup product picture window.

 

Here is the code I am using:

 

<p align="center"><?php echo '<a href="java script:window.close()">' . tep_image_button('button_close_window.gif', IMAGE_BUTTON_CLOSE_WINDOW) . '</a>'; ?>

 

Can anyone tell me how image magic determines NOT to watermark an image? I thought the tep_image_button would have done it.

 

Have a great Day!

 

Todd

Link to comment
Share on other sites

Here is the solution to this:

 

Call-time pass-by-reference has been deprecated - argument passed by value;

 

These changes make imagemagic.php PHP5 compliant.

 

Change lines 269-274 in imagemagic.php.

 

From:

if (BRIGHTNESS_ADJUST != "0") adjust_brightness(&$tmp_img,BRIGHTNESS_ADJUST);

if (CONTRAST_ADJUST != "0") adjust_contrast(&$tmp_img, CONTRAST_ADJUST);

if ($image_watermark) watermark_image(&$tmp_img, DIR_FS_CATALOG.'includes/imagemagic/watermarks/'.WATERMARK_IMAGE ,WATERMARK_IMAGE_POSITION, WATERMARK_IMAGE_OPACITY, WATERMARK_IMAGE_MARGIN);

if ($frame) frame(&$tmp_img, FRAME_WIDTH, FRAME_EDGE_WIDTH, FRAME_COLOR, FRAME_INSIDE_COLOR1, FRAME_INSIDE_COLOR2);

if ($bevel) bevel(&$tmp_img, BEVEL_HEIGHT, BEVEL_HIGHLIGHT, BEVEL_SHADOW);

if ($text_watermark) watermark_text(&$tmp_img, WATERMARK_TEXT, WATERMARK_TEXT_SIZE, WATERMARK_TEXT_POSITION, WATERMARK_TEXT_COLOR, 'includes/imagemagic/fonts/'.WATERMARK_TEXT_FONT, WATERMARK_TEXT_OPACITY, WATERMARK_TEXT_MARGIN, WATERMARK_TEXT_ANGLE);

 

 

To:

if (BRIGHTNESS_ADJUST != "0") adjust_brightness($tmp_img,BRIGHTNESS_ADJUST);

if (CONTRAST_ADJUST != "0") adjust_contrast($tmp_img, CONTRAST_ADJUST);

if ($image_watermark) watermark_image($tmp_img, DIR_FS_CATALOG.'includes/imagemagic/watermarks/'.WATERMARK_IMAGE ,WATERMARK_IMAGE_POSITION, WATERMARK_IMAGE_OPACITY, WATERMARK_IMAGE_MARGIN);

if ($frame) frame($tmp_img, FRAME_WIDTH, FRAME_EDGE_WIDTH, FRAME_COLOR, FRAME_INSIDE_COLOR1, FRAME_INSIDE_COLOR2);

if ($bevel) bevel($tmp_img, BEVEL_HEIGHT, BEVEL_HIGHLIGHT, BEVEL_SHADOW);

if ($text_watermark) watermark_text($tmp_img, WATERMARK_TEXT, WATERMARK_TEXT_SIZE, WATERMARK_TEXT_POSITION, WATERMARK_TEXT_COLOR, 'includes/imagemagic/fonts/'.WATERMARK_TEXT_FONT, WATERMARK_TEXT_OPACITY, WATERMARK_TEXT_MARGIN, WATERMARK_TEXT_ANGLE);

 

Gary

 

Hello

 

I have exactly the same problems that Sean.

 

The only thing I haven't tried is to turn php safe to off (I'm restricted of doing it).

 

Please, could somebody help us.

Thanks

Patrice

www.clubfitting.net (my shop being live, I will have to switch off IM)

Link to comment
Share on other sites

Hi all,

 

Sorry I haven't been about much...really snowed under at the mo.

Having said that, it's great to see you all helping each other out here and the thread taking on a life of its own without me.

 

Anyways, just letting you all know, that I did find time to update Image Magic a little and fix a few bugs described here.

 

The new version is here

 

Tom

OSC Image Magic

On-the-fly thumbnails, watermarks and image processing

Link to comment
Share on other sites

Hi,

 

Very nice contribution!

 

On my server SAFE MODE is ON and is not to be changed.

 

My problem:

I have subfolders for images.

If Image Magic creates this folders by itself and adds the thumbnails, it is not able to read and display them.

 

If I create all folders myself and Image Magic only creates the thumbs, all works perfect.

 

I am not able to remove the folders / thumbs created by Image Magic via FTP even, I get a SAFE MODE restriction.

 

What do I have to do, to be able to remove the autocreated folders and thumbs or how could the imagemagic.php be modified to work correct with autocreated folders?

 

Thanks for help!

 

G?tz

Edited by texmaxx
Link to comment
Share on other sites

Anyone know why my images won't show and I paste the link into the browser it gives me these errors?

 

 

Warning: chdir(): No such file or directory (errno 2) in /var/www/whatever.com/html/catalog/imagemagic.php on line 16

 

Warning: Cannot modify header information - headers already sent by (output started at /var/www/whatever.com/html/catalog/imagemagic.php:16) in /var/www/whatever.com/html/catalog/imagemagic.php on line 462

 

Warning: Cannot modify header information - headers already sent by (output started at /var/www/whatever.com/html/catalog/imagemagic.php:16) in /var/www/whatever.com/html/catalog/imagemagic.php on line 463

 

Warning: Cannot modify header information - headers already sent by (output started at /var/www/whatever.com/html/catalog/imagemagic.php:16) in /var/www/whatever.com/html/catalog/imagemagic.php on line 472

 

Warning: Cannot modify header information - headers already sent by (output started at /var/www/whatever.com/html/catalog/imagemagic.php:16) in /var/www/whatever.com/html/catalog/imagemagic.php on line 175

????

????

 

Thanks!

Link to comment
Share on other sites

Finally it's working, and I can leave this thread for awhile.

I just kept modifying the WRONG configure.php file.

Out of exasperation I downloaded configure.php from my server again, to make sure I was working with the correct one, and wallah.

It was a different one. Modified the directory path and all works perfectly thus far.

 

Great contrib!

Link to comment
Share on other sites

Hi All,

 

I have recently installed imagemagic 1.14, but cannot tell if it works correctly.

 

On some pop-ups I find some images small and some large, cannot get them to be the same.

 

Any ideas,

 

My site is at My Webpage

 

Regards

Link to comment
Share on other sites

Hi All,

 

I have recently installed imagemagic 1.14, but cannot tell if it works correctly.

 

On some pop-ups I find some images small and some large, cannot get them to be the same.

 

Any ideas,

 

My site is at My Webpage

 

Regards

 

 

Yes, your popups will be exactly the same size as the original (small, tall, wee or otherwise)

Tom

OSC Image Magic

On-the-fly thumbnails, watermarks and image processing

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...