Jump to content
Sign in to follow this  
tomjmul

Support thread for the Image Magic contribution

Recommended Posts

For all who have the problem with not dhowing the image (if you have configured your store in a sub folder) change in /catalog/imagemagick.php round line: 21

chdir (DIR_FS_CATALOG)

to:

chdir (DIR_FS_CATALOG . DIR_WS_HTTP_CATALOG)

or to: chdir (DIR_FS_CATALOG . '/your_folder_name/')

 

it did the trick for me!

(I figured it out when I disabled the error reporting by adding the php function: error_reporting(0);)

Good luck

 

Boudy

Share this post


Link to post
Share on other sites

@mike:

 

Have you tried the errorreporting?

Also make sure you close the altered line with a ;

chdir (DIR_FS_CATALOG . DIR_WS_HTTP_CATALOG);

@ darren:

There are no issues related to mysql 5 with image magic:

Make sure GD library support is installed, they have probably updated to PHP 5 aswell.

 

Boudy

Edited by Boudy

Share this post


Link to post
Share on other sites
Nope, still getting no images. My store is located in "shop" in the root html directory...

 

I corrected this issue by creating the 'thumbnail' directory/folder in the root of my /catalog directory/folder, and changing the permissions on the 'thumbnail' folder to '777'. Once I did this and refreshed my browser, the images appeared.

Share this post


Link to post
Share on other sites

I've got ImageMagic working fine for all my various category product images, but my 'New Products' page or 'What's New Here' page are showing the images in their original size -- not the thumbnail. I'm quite certain the issue is somewhere in the new_products.php, but I'm just not sure how to correct this issue. Below is the code of my new_products.php... Any help or suggestions will be appreciated.

 

<?php

/*

$Id: new_products.php,v 1.1.1.1 2006/08/14 09:45:13 User Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

?>

<script language="javascript"><!--

function popupWindow(url) {

window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res

izable=yes,copyhistory=no,width=290,height=290,screenX=290,screenY=290,top=150,le

ft=150');

}

//--></script>

 

<!-- new_products //-->

<?php

$info_box_contents = sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B'));

if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {

$new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);

} else {

$new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);

}

$row = 0;

$col = 0;

?>

 

<table border="0" cellspacing="1" cellpadding="0" class="zxc6">

<tr><td style="background-image:url(images/m22.gif);" width="531" height="31">          <span class="tx2"><?=HEADING_TITLE?></span></td></tr>

<tr><td height="2"></td></tr>

<tr><td width="533">

 

<table border="0" cellspacing="0" cellpadding="0" width="527" align="center">

<?

while ($new_products = tep_db_fetch_array($new_products_query)) {

$new_products['products_name'] = tep_get_products_name($new_products['products_id']);

$product_query = tep_db_query("select products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$new_products['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

$product = tep_db_fetch_array($product_query);

$new_products['products_description'] = $product['products_description'];

if ($col==0) echo '<tr>';

if ($col!=0) echo '<td width="2"></td>';

?>

 

<td width="174" valign="top" class="bd">

<table border="0" cellspacing="0" cellpadding="0" width="167" align="center">

<tr><td height="2"></td></tr>

<tr><td width="167" height="89" bgcolor="#FFFFFF" align="center"><a href="<?=tep_href_link('product_info.php?products_id='.$new_products['products_id'])?>"><?=tep_image(DIR_WS_IMAGES.$new_products['products_image'],$new_products['products_name'])?></a></td></tr>

<tr><td width="167" height="35" bgcolor="#1A1C1F" class="tx4"><br style="line-height:1px;"><br style="line-height:2px;"><b><a style="color:#C4DBF2;text-decoration:none;" href="<?=tep_href_link('product_info.php?products_id='.$new_products['products_id'])?>"><?=$new_products['products_name']?></a></b><br style="line-height:1px;"><br style="line-height:4px;"></td></tr>

<tr><td width="167" style="padding-left:12px;"><br style="line-height:1px;"><br style="line-height:10px;"><b><?=preg_replace('/\s\S*$/i', '', substr($new_products['products_description'], 0, 75))?>...</b><br style="line-height:1px;"><br style="line-height:10px;"></td></tr>

<tr><td width="167" style="padding-left:12px;" class="tx6"> <?=$currencies->display_price($new_products['products_price'],'')?><br style="line-height:1px;"><br style="line-height:10px;"></td></tr>

<tr><td><a href="<?=tep_href_link('product_info.php?products_id='.$new_products['products_id'])?>"><?=tep_image_button("button_more.gif");?></a><a href="<?= tep_href_link("products_new.php","action=buy_now&products_id=".$new_products['products_id'])?>"><?=tep_image_button("button_add_to_cart.gif");?></a></td></tr>

<tr><td height="3"></td></tr>

</table>

</td>

<?

 

if ($col==2) {

echo '</tr>';

$col=0;

} else {

$col++;

}

 

}

 

if ($col!=0) echo '</tr>';

 

?>

 

</table>

 

 

</td>

</tr>

</table>

Share this post


Link to post
Share on other sites

Hey guys, i have a quick question, i noticed some of my pics are comming up fine, while others that are in lets say images/44/picname.jpg, are not comming up, is this cause i have some of my images in a sub folder in the images folder? And if this is the problem is there a code in the imagemagic.php thati can change so it reads files that i are in subfolders to cache them? Thanks

 

Jon


===========================

Remember Always Back UP!

___________________________________

Share this post


Link to post
Share on other sites
Hey guys, i have a quick question, i noticed some of my pics are comming up fine, while others that are in lets say images/44/picname.jpg, are not comming up, is this cause i have some of my images in a sub folder in the images folder? And if this is the problem is there a code in the imagemagic.php thati can change so it reads files that i are in subfolders to cache them? Thanks

 

Jon

 

 

I had to add to this also, i was looking around and i noticed, imagemagic is creating my pics under thumbnails, and the folder is set to 777, and i can even look at them, but their not showing up on my site? Ne ideas guys thank...

 

Jon


===========================

Remember Always Back UP!

___________________________________

Share this post


Link to post
Share on other sites
I had to add to this also, i was looking around and i noticed, imagemagic is creating my pics under thumbnails, and the folder is set to 777, and i can even look at them, but their not showing up on my site? Ne ideas guys thank...

 

Jon

 

 

Jon,

If you haven't already done so, edit your configure.php located under your /includes subfolder and check to make sure this line of code... (approx. line 33)

 

define('DIR_FS_CATALOG', '/pathtocatologroot/');

 

is correctly pointing to the path of your /catalog folder. If you don't have a /catalog folder, such as with my store, make sure it points to the store root (where all your main .php files are stored, including imagemagic.php).

Share this post


Link to post
Share on other sites
I corrected this issue by creating the 'thumbnail' directory/folder in the root of my /catalog directory/folder, and changing the permissions on the 'thumbnail' folder to '777'. Once I did this and refreshed my browser, the images appeared.

 

 

It is already in the root, and chmod'd to 777

Share this post


Link to post
Share on other sites
I've got ImageMagic working fine for all my various category product images, but my 'New Products' page or 'What's New Here' page are showing the images in their original size -- not the thumbnail. I'm quite certain the issue is somewhere in the new_products.php, but I'm just not sure how to correct this issue. Below is the code of my new_products.php... Any help or suggestions will be appreciated.

 

<?php

/*

$Id: new_products.php,v 1.1.1.1 2006/08/14 09:45:13 User Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright ? 2003 osCommerce

 

Released under the GNU General Public License

*/

?>

<script language="javascript"><!--

function popupWindow(url) {

window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res

izable=yes,copyhistory=no,width=290,height=290,screenX=290,screenY=290,top=150,le

ft=150');

}

//--></script>

 

<!-- new_products //-->

<?php

$info_box_contents = sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B'));

if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {

$new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);

} else {

$new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);

}

$row = 0;

$col = 0;

?>

 

<table border="0" cellspacing="1" cellpadding="0" class="zxc6">

<tr><td style="background-image:url(images/m22.gif);" width="531" height="31">          <span class="tx2"><?=HEADING_TITLE?></span></td></tr>

<tr><td height="2"></td></tr>

<tr><td width="533">

 

<table border="0" cellspacing="0" cellpadding="0" width="527" align="center">

<?

while ($new_products = tep_db_fetch_array($new_products_query)) {

$new_products['products_name'] = tep_get_products_name($new_products['products_id']);

$product_query = tep_db_query("select products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$new_products['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

$product = tep_db_fetch_array($product_query);

$new_products['products_description'] = $product['products_description'];

if ($col==0) echo '<tr>';

if ($col!=0) echo '<td width="2"></td>';

?>

 

<td width="174" valign="top" class="bd">

<table border="0" cellspacing="0" cellpadding="0" width="167" align="center">

<tr><td height="2"></td></tr>

<tr><td width="167" height="89" bgcolor="#FFFFFF" align="center"><a href="<?=tep_href_link('product_info.php?products_id='.$new_products['products_id'])?>"><?=tep_image(DIR_WS_IMAGES.$new_products['products_image'],$new_products['products_name'])?></a></td></tr>

<tr><td width="167" height="35" bgcolor="#1A1C1F" class="tx4"><br style="line-height:1px;"><br style="line-height:2px;"><b><a style="color:#C4DBF2;text-decoration:none;" href="<?=tep_href_link('product_info.php?products_id='.$new_products['products_id'])?>"><?=$new_products['products_name']?></a></b><br style="line-height:1px;"><br style="line-height:4px;"></td></tr>

<tr><td width="167" style="padding-left:12px;"><br style="line-height:1px;"><br style="line-height:10px;"><b><?=preg_replace('/\s\S*$/i', '', substr($new_products['products_description'], 0, 75))?>...</b><br style="line-height:1px;"><br style="line-height:10px;"></td></tr>

<tr><td width="167" style="padding-left:12px;" class="tx6"> <?=$currencies->display_price($new_products['products_price'],'')?><br style="line-height:1px;"><br style="line-height:10px;"></td></tr>

<tr><td><a href="<?=tep_href_link('product_info.php?products_id='.$new_products['products_id'])?>"><?=tep_image_button("button_more.gif");?></a><a href="<?= tep_href_link("products_new.php","action=buy_now&products_id=".$new_products['products_id'])?>"><?=tep_image_button("button_add_to_cart.gif");?></a></td></tr>

<tr><td height="3"></td></tr>

</table>

</td>

<?

 

if ($col==2) {

echo '</tr>';

$col=0;

} else {

$col++;

}

 

}

 

if ($col!=0) echo '</tr>';

 

?>

 

</table>

 

 

</td>

</tr>

</table>

 

 

To add to this:

 

The problem is that ImageMagic is not process the new_products or products_new.php files, therefore the images that are being called up are in their original state (large) and not in the thumbnail size. Does anyone have any ideas how to correct this?

Share this post


Link to post
Share on other sites
Jon,

If you haven't already done so, edit your configure.php located under your /includes subfolder and check to make sure this line of code... (approx. line 33)

 

define('DIR_FS_CATALOG', '/pathtocatologroot/');

 

is correctly pointing to the path of your /catalog folder. If you don't have a /catalog folder, such as with my store, make sure it points to the store root (where all your main .php files are stored, including imagemagic.php).

 

Thank for the response, my configure file is set, it is at

define('DIR_FS_CATALOG', '/var/www/vhosts/tarojoenterprises.com/httpdocs/store/');

 

Ne more ideas thank

 

Jon


===========================

Remember Always Back UP!

___________________________________

Share this post


Link to post
Share on other sites

Hello

 

I am new at oscommerce. I am trying to instal this contribution, but there is a problem.

 

I have installed it as it is written in readme...

 

In admin everything is fine, but on my page where the images should be there is a note catche error...

 

This happens when i change /catalog/includes/functions/html_output.php

 

There are some things written on previous pages but i dont understand a thing.

 

Please help so that my page will look better...

 

Thanks

Share this post


Link to post
Share on other sites

Hi Folks,

 

What do I need to do to get the text watermarks to work?

 

I can easely get the image watermark to work!

 

Any iedeas to what could be wrong?

 

Thanks in advance,

 

/Thomas

Share this post


Link to post
Share on other sites

Hello-

 

I have a rather large store with over 9,500 items, and not all of them have photos, so I use a default image for items in each category that don't have photos.

 

When looking at the product_info page for one of these items, if another item using the same default image is in the New Items infobox, it makes the thumbnail for the infobox the same (larger) size as the thumbnail for the product_info layout.

 

Has anyone found a fix for this? I havent been able to find one in this thread.

 

Thanks!

Robert

Share this post


Link to post
Share on other sites

Robert,

 

this problem was discussed, and i believed a solution offered, a few pages ago - sorry i can't be more specific - iirc, it's back in an area where Vines was posting a lot of messages (perhaps 5 to 10 pages back - maybe less)...

Share this post


Link to post
Share on other sites

Curious - I had to troubleshoot imagemagic to get it to display the images on the site. I had to create the thumbnails directory and the thumbnails/images directory. Both set to 777.

 

Is this a missing step in the instructions or is it related to an issue I have on my server?

Share this post


Link to post
Share on other sites
This sounds like the same problem I had in admin whenever I selected one of options that had to have a dropdown menu to select from ( watermark image, watermark position, text font and text position) when I would hit edit, the column would disappear. I also checked an checked the database for something that was off, but nada.

 

So it ended up being the code added (from readme/installation v1.14/1.15 step#5) for catalog/admin/includes/functions/general.php - thats what worked for me (because I am using a modified version for cre and everything worked except those functions and I was missing that bit of code added to general.php)

 

May not be the same problem as yours but it sounds similar so I thought I would throw in what worked for me. Hope it helps in some way!

 

And thanks Tom and everyone who has contributed to this contrib, its excellent!

 

 

I am having the exact problem as described above, however, I have already installed the code snippet as described and have verified (several times) it is in fact there. Also, there are no problems in the DB either. I have my store pretty much up and running with very few problems left to fix, but this is one of them. I want to change a few things with the text font and the text position but I cannot. This is on a Windows 2003 server and also the root of my store is just / not /catalog.

 

If anyone has any suggestions as how to fix this, I would appreciate it. I know that pretty much everything else is configured correctly because I have other mods working.

 

Last question: If I want to use a multi-pic mod like this one: http://www.oscommerce.com/community/contri...l/search,images

 

Would it be compatible with this mod? I would like to have several images to choose from.

 

 

Thanks!

 

-- Rootuser

Share this post


Link to post
Share on other sites
The only advice I can offer without checking out your files is to make sure that your

 

DIR_FS_DOCUMENT_ROOT is properly set in /catalog/includes/configure.php

 

The code below in /catalog/admin/includes/functions/general.php should reference the directory where the watermark images are stored

 

DIR_FS_DOCUMENT_ROOT.'includes/imagemagic/watermarks'

 

To test, you can always do an echo somewhere after the configure.oho file has been included

 

echo DIR_FS_DOCUMENT_ROOT.'includes/imagemagic/watermarks';

 

i have read all 50 pages and implemented all different configs to get this working from what i have read but still no dropdown on image watermarks and text watermarks are you still offering your install service or can anyone care to take a look for me

thanks

 

Robert

 

ps: my shop i located in a folder called store

Share this post


Link to post
Share on other sites

I'm struggling with my fresh install of Image Magic.

 

Further up this page was a few comments which I've checked, but I was wondering if my image paths look ok.

 

With IM turned off, my images shows and has this url (yep I've changed the http:// bit to stop any changes when being displayed in this post)

hppt//mystore.co.uk/store/images/ML01181.jpg

This is the url when IM is turned on

hppt//mystore.co.uk/store/imagemagic.php?img=images/ML01181.jpg&w=100&h=87&page=prod_info

 

Can anyone comment If the above is okay please? (I have created a folder 'thumbnails' which remain empty)

 

Thanks in advance of any help :)

 

Steve


____________________________________________________________________

____________________________________________________________________

Share this post


Link to post
Share on other sites
yes steve your image path is correct.

 

here is mine below

http://mysite.com/store/imagemagic.php?img...h=198&page=

 

have you set the thumbnails folder to 777 on the server

Thanks for the reply.

 

I have double checked the folder, and it is 777 :) Somewhere in this thread, someone suggested an additional folder inside thumbnails called images, so I've added that as well.

 

If I right click on an image and select 'view image' (Mozilla Firefox) I get

Warning: chdir(): No such file or directory (errno 2) in /home/unclesteve/public_html/store/imagemagic.php on line 23

 

Warning: Cannot modify header information - headers already sent by (output started at /home/unclesteve/public_html/store/imagemagic.php:23) in /home/unclesteve/public_html/store/imagemagic.php on line 494

 

Warning: Cannot modify header information - headers already sent by (output started at /home/unclesteve/public_html/store/imagemagic.php:23) in /home/unclesteve/public_html/store/imagemagic.php on line 495

 

Warning: Cannot modify header information - headers already sent by (output started at /home/unclesteve/public_html/store/imagemagic.php:23) in /home/unclesteve/public_html/store/imagemagic.php on line 496

 

Warning: Cannot modify header information - headers already sent by (output started at /home/unclesteve/public_html/store/imagemagic.php:23) in /home/unclesteve/public_html/store/imagemagic.php on line 497

 

Warning: Cannot modify header information - headers already sent by (output started at /home/unclesteve/public_html/store/imagemagic.php:23) in /home/unclesteve/public_html/store/imagemagic.php on line 498

 

Warning: Cannot modify header information - headers already sent by (output started at /home/unclesteve/public_html/store/imagemagic.php:23) in /home/unclesteve/public_html/store/imagemagic.php on line 499

???? ---EDIT --- a lot of rubbish, so snipped it

 

/home/unclesteve/public_html/store/imagemagic.php

line 20: require('includes/imagemagic/imagemagic.functions.php');
line 21: // chdir (DIR_FS_CATALOG); //unclesteve this is the original
line 22: //chdir (DIR_FS_CATALOG . DIR_WS_HTTP_CATALOG);  //unclesteve forum suggests this
line 23: chdir (DIR_FS_CATALOG . '/home/unclesteve/public_html/store/');  //unclesteve forum suggests this as an alternative

As you can see above, there are similar lines that have been commented out, I've tried them all, and get the same result with each

 

/home/unclesteve/public_html/store/imagemagic.php

line 493: // show a custom error-image (non-cacheable by the browser)			
line 494: header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");				// Date in the past
line 495: header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");	// Always modified
line 496: header("Cache-Control: no-store, no-cache, must-revalidate");		// HTTP/1.1
line 497: header("Cache-Control: post-check=0, pre-check=0", false);			// HTTP/1.1
line 498: header("Pragma: no-cache");														line 499: // HTTP/1.0

BTW store = catalog, but you knew that ;)

 

Can anyone make any comments on the above please?

Edited by UncleSteve

____________________________________________________________________

____________________________________________________________________

Share this post


Link to post
Share on other sites

Hi there,

 

I have some problems with the installation of this contribution.

 

The Image Magic under Configuration works good. I can add watermark in the pictures and cache thumbnails.

There is an alt tag installed for every picture and the url for every picture is good i think (example http://localhost/osc/imagemagic.php?img=im...=117&page=)

 

But i cannot change the width and height of pictures. I included a thumb of my admin/pictures

It is in Dutch but that shouldn't be of any problem i think.

 

plaatjes.jpg

 

But the problem is that every picture is shown in widht 90 (the small image format). But i want to work with 80 width in all products page and 150 width in the individual product pages. I hope someone can help me with this. I am rather new with oscommerce so i do hope i gave you enough information for this problem.

 

Best regards,

Emiel

Share this post


Link to post
Share on other sites

okay as i cannot select fonts or a watermark image dropdown. can some one please post me the address of when you click UPPDATE after changing the font so i can do this manually the address below is for edit as everything works apart from this one feature.

 

https://www.mysite.com/store/admin/configur...amp;action=edit

 

or can i change the dropdown to radio buttons.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×