Jump to content



* * * * * 3 votes

[Contribution] oscThumb


  • Please log in to reply
442 replies to this topic

#21   jeebus

jeebus
  • Members
  • 24 posts
  • Real Name:Dave

Posted 29 October 2007 - 02:41 PM

View Postrigadin2, on Oct 26 2007, 10:43 AM, said:

For the sql error, you have to define your TABLE_ADDITIONAL_IMAGES constant into admin/includes/databases.php, like: define ('TABLE_ADDITIONAL_IMAGES', 'additional_images'), value depending of the real name of the table.

The constants you mentionned in the oscthumb class are the configuration parameters you see in admin. You won't see any define(.....) because all these parameters are automatically created in application_top.php .


To be honest I'm content now that I have the text watermark working. I have no need for the image watermark. However to my error above...

1146 - Table 'comotors_p_os1.TABLE_ADDITIONAL_IMAGES' doesn't exist

delete from TABLE_ADDITIONAL_IMAGES where products_id = '69'

[TEP STOP]


I know you tried to help with the answer but I'm still not sure what I need to do here. I'd like to fix this issue as everytime I try deleting a product I get that error. It's just a bit unsettling when working on the site.

Is there code from a specific file that I could post up that would help? I know this error came when I was modifing the existing files with the code changes. I just don't know what I messed up.

Thanks.

Edited by jeebus, 29 October 2007 - 02:43 PM.


#22   jeroenvoc

jeroenvoc
  • Members
  • 1 posts
  • Real Name:www.livegamer.nl

Posted 29 October 2007 - 09:46 PM

Hy, this contrib look very promissing to me.
I started implementing right away, but I got another problem:
I did the install manual, but from the moment I make the addition in catalog/includes/functions/html_output.php The website shows no output whatsoever.

Where did I go wrong?

Jeroen

#23   rigadin2

rigadin2
  • Members
  • 349 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Helsinki/St-Petersburg

Posted 30 October 2007 - 07:57 AM

By "No output" do you mean no images or a blank page? Certainly something went wrong when modifying html_output.php . There is one function to rename, and a new one to copy in from the contribution. Best use a file compare program like Beyond Compare or WinMerge.

- Chris
STS v4.5 SP5 is out, and check the STS Power Pack contribution too!
New thumbnailer using phpThumb: oscThumb. Works great.

#24   rigadin2

rigadin2
  • Members
  • 349 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Helsinki/St-Petersburg

Posted 30 October 2007 - 08:00 AM

View Postjeebus, on Oct 29 2007, 06:41 PM, said:

To be honest I'm content now that I have the text watermark working. I have no need for the image watermark. However to my error above...

1146 - Table 'comotors_p_os1.TABLE_ADDITIONAL_IMAGES' doesn't exist

delete from TABLE_ADDITIONAL_IMAGES where products_id = '69'

[TEP STOP]
I know you tried to help with the answer but I'm still not sure what I need to do here. I'd like to fix this issue as everytime I try deleting a product I get that error. It's just a bit unsettling when working on the site.

Is there code from a specific file that I could post up that would help? I know this error came when I was modifing the existing files with the code changes. I just don't know what I messed up.

Thanks.

Are you using some kind of multi-product-image contribution? If not, check in admin/categories.php where the word TABLE_ADDITIONAL_IMAGES is used and remove it.
STS v4.5 SP5 is out, and check the STS Power Pack contribution too!
New thumbnailer using phpThumb: oscThumb. Works great.

#25   sultanos

sultanos
  • Members
  • 42 posts
  • Real Name:Javier
  • Gender:Male
  • Location:Spain

Posted 31 October 2007 - 12:53 PM

Hy i followed all the steps in the instalation although i come up with some errors . I am using CakePhp , although my instalation is at cakePhp webroot and works fine when i disable the contribution, my problem comes with the paths i will show the diferents errors i get as i change the configuration
$PHPTHUMB_CONFIG['document_root'] = '/catalog';
with the path defined as above i get this errors
[img]http://www.alvdealer.com/catalog/images/fallos/falloconbarracatalogennovedades.jpg[/img]
[img]http://www.alvdealer.com/catalog/images/fallos/falloconbarracatalog.jpg[/img]

$PHPTHUMB_CONFIG['document_root'] = DIR_FS_CATALOG;
with the path defined as above i get this errors
[img]http://www.alvdealer.com/catalog/images/fallos/falloconrootdeoscmmerce1.jpg[/img]
[img]http://www.alvdealer.com/catalog/images/fallos/falloconrootdeoscmmerce2.jpg[/img]


I have also try this settings but i still get the more or less same mistakes with a mismached path , i have 2.2 version.
the working url Now is www.alvdealer.com/catalog where i  deactivated the thumbnail at the moment.

//$PHPTHUMB_CONFIG['document_root'] = 'http://www.alvdealer.com/catalog';
//$PHPTHUMB_CONFIG['document_root'] = '/catalog';
//$PHPTHUMB_CONFIG['document_root'] = $_SERVER['DOCUMENT_ROOT'].'/catalog';
//$PHPTHUMB_CONFIG['document_root'] = realpath((@$_SERVER['DOCUMENT_ROOT'] && file_exists(@$_SERVER['DOCUMENT_ROOT'].$_SERVER['PHP_SELF'])) ? $_SERVER['DOCUMENT_ROOT'] : str_replace(dirname(@$_SERVER['PHP_SELF']), '', str_replace($phpThumb->osslash, '/', realpath('.'))));
//$PHPTHUMB_CONFIG['document_root'] = realpath((getenv('DOCUMENT_ROOT') && ereg('^'.preg_quote(realpath(getenv('DOCUMENT_ROOT'))), realpath(__FILE__))) ? getenv('DOCUMENT_ROOT') : str_replace(dirname(@$_SERVER['PHP_SELF']), '', str_replace($phpThumb->osslash, '/', dirname(__FILE__))));

If you are not part of the solution, you are part of the problem

#26   sultanos

sultanos
  • Members
  • 42 posts
  • Real Name:Javier
  • Gender:Male
  • Location:Spain

Posted 31 October 2007 - 02:44 PM

i solved with this lines..

$PHPTHUMB_CONFIG['document_root'] = realpath((getenv('DOCUMENT_ROOT') && ereg('^'.preg_quote(realpath(getenv('DOCUMENT_ROOT'))), realpath(__FILE__))) ? getenv('DOCUMENT_ROOT') : str_replace(dirname(@$_SERVER['PHP_SELF']), '', str_replace($phpThumb->osslash, '/', dirname(__FILE__)))).'/app/webroot/catalog';

Hope it helps
If you are not part of the solution, you are part of the problem

#27   twjnorth

twjnorth
  • Members
  • 11 posts
  • Real Name:Trevor North

Posted 03 November 2007 - 12:25 AM

It's a really nice addon to oscommerce.  Didnt have too many problems installing it locally but did notice the following issues

On the Osc 2.2 MS2 version, if you switch on Search Engine Safe URLs in the configuration section of the admin screens, it changes the name of the url so the 'Click To Enlarge' URL becomes i.e. popup_image.php is no longer the basename

  localhost/dashuk/catalog/popup_image.php/pID/28?osCsid=bc4484c83ed81c3c880b8a5c25dc59f7

The code can no longer use this to determine the image being displayed is a popup and so displays the original image without any watermarking - i presume other SEO URL rewrite addons will have the same issue.

If i switch off this option in configuration, then the  'Click to Enlarge' URL becomes   localhost/dashuk/catalog/popup_image.php?pID=29&osCsid=bc4484c83ed81c3c880b8a5c25dc59f7 and it does add the watermark text.

Ideally i think it would need a difference watermark text size for the SMALL images compared to the POPUP ones because a font size of 10 is fine for a thumbnail of about 100 pixels wide but when you show the same font size on a full size image, it's way too small.

The same issue with URL rewrite stops the difference size for the product_info.php page working if you are using search engine safe/friendly URLs so it doesnt create a thumbnail in the new size

Hope this information is helpful

#28   fmucar

fmucar
  • Members
  • 4 posts
  • Real Name:fatih mehmet ucar

Posted 06 November 2007 - 12:31 AM

I am having problems with the addon.

I have 2 copies of my site, one is local for testing purposes and the production site hosted on godaddy.com

Installed the addon on my local computer and everything is fine and working but
when i installed to the prod. site I could not make it work.

when I turn off it via admin everything works fine but if it is set to on, then all images shows their alt texts.
I think I having some path issues but could not figure it out.

does anyone has faced sth like this?

below are one of the pictures URLs.

http://www.hediyesehri.com/catalog/oscthum...8fe898bdae50994

<img src="oscthumb.php?src=o93S1NvZ55TX6tijx9_V2NnE5eni4srlotvdyw..&w=100&h=80&f=gif&bg=FFFFFF&q=95&hash=9ccf01fd6f0dc07bd8fe898bdae50994" w="100" h="80" border="0" alt="Blade Runner - Director's Cut" title="Blade Runner - Director's Cut">


what am I doing wrong?

hope someone can help me, thanks.

#29   twjnorth

twjnorth
  • Members
  • 11 posts
  • Real Name:Trevor North

Posted 06 November 2007 - 09:19 AM

Merhaba fmucar, Nasil siniz ?

I went to your website and navigated through to the blade runner DVD but if you right click on the "Click to enlarge" text, choose "Copy Shortcut" and then paste this into a text editor such as notepad, it gives the URL
java script:popupWindow('http://www.hediyesehri.com/catalog/popup_image.php?pID=5') which indicates that you have switched off the thumbnails in the control panel.  

I noted Godaddy.com also seems to be putting a banner across the top of your popup window which shows above the thumbnail image which might not be what you want.

As to your problem, if i go to your homepage (www.hediyesehri.com), your host indicates that you have not uploaded your site correctly so it might be something to do with an absolute path that assumes website_home/thumbs_directory so see if you are able to change the starting directory for the domain name to be //your_webspace/catalog or if you arent using the webspace for anything else, see if you can move the whole website up a level so that everything in /catalog is at the top level of your webspace.  (You only want to do this if you dont want to run more than one website on your webspace).

Did you upload the oscthumbs mod into the catalog directory or into the top level of your webspace ?

Hope that helps

Iyi Gunler

Trevor

#30   fmucar

fmucar
  • Members
  • 4 posts
  • Real Name:fatih mehmet ucar

Posted 07 November 2007 - 09:42 AM

View Posttwjnorth, on Nov 6 2007, 11:19 AM, said:

Merhaba fmucar, Nasil siniz ?

I went to your website and navigated through to the blade runner DVD but if you right click on the "Click to enlarge" text, choose "Copy Shortcut" and then paste this into a text editor such as notepad, it gives the URL
java script:popupWindow('http://www.hediyesehri.com/catalog/popup_image.php?pID=5') which indicates that you have switched off the thumbnails in the control panel.  

I noted Godaddy.com also seems to be putting a banner across the top of your popup window which shows above the thumbnail image which might not be what you want.

As to your problem, if i go to your homepage (www.hediyesehri.com), your host indicates that you have not uploaded your site correctly so it might be something to do with an absolute path that assumes website_home/thumbs_directory so see if you are able to change the starting directory for the domain name to be //your_webspace/catalog or if you arent using the webspace for anything else, see if you can move the whole website up a level so that everything in /catalog is at the top level of your webspace.  (You only want to do this if you dont want to run more than one website on your webspace).

Did you upload the oscthumbs mod into the catalog directory or into the top level of your webspace ?

Hope that helps

Iyi Gunler

Trevor


merhaba,
cevap için tşk ederim.
Devamını herkesin anlaması için ingilizce yazacagım.
Turkiye'de mi ogrendiniz Türkçeyi?

İyi günler.




I have switched off the addon cause when it is on I cant see any pictures.

About the banners  on top of the page; The site is not live yet and I am using a trial version for hosting from godaddy.com for testing purposes.
The catalog folder is at the top path for the domain. Copied the catalog directory to the web root and installed it from there.

You are right, I also think that there is sth wrong with the paths but instead of copying all content of catalog/ to web root, I think
it would be better if I change the path to the domain to ../webroot/catalog/.

oscthumbs dir is in the catalog directory. I think I should be editing some files so that the path to "oscthumbs/" is like "/catalog/oscthumbs" but I could not find the right place to edit.

Currently I dont have access to the ftp of my domain but in 7 hours from now
I will be copying oscthumbs/ directory to web root and will test it to see if it works.

Thx.

#31   fmucar

fmucar
  • Members
  • 4 posts
  • Real Name:fatih mehmet ucar

Posted 07 November 2007 - 09:43 AM

I also turned on the oscthumb, if you need to see what it looks like :-)

#32   jeebus

jeebus
  • Members
  • 24 posts
  • Real Name:Dave

Posted 07 November 2007 - 02:44 PM

So I have another question relating to speed/load times.

It seems to take a long time to load or generate images. Is this contribution creating the thumbnails on every page load?

Is there anything I can do to help speed up the product image load times? I'm fairly new to OSC so I don't know of any settings or options that I may need to change in order to make this work better.

Here is a link to the site. It's not "live" yet so there's no other traffic then just me.

http://comotorsports.net/osCommerce/catalog/index.php

The page always takes a bit to load initially however after that it works very quick other then the images itself. The images tend to always take a while to load.

Edited by jeebus, 07 November 2007 - 02:47 PM.


#33   rigadin2

rigadin2
  • Members
  • 349 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Helsinki/St-Petersburg

Posted 08 November 2007 - 11:03 AM

oscThumb has a cache feature. By default,  cached files are stored is in catalog/phpThumb/cache, this directory must be writeable. You can watch there if you have thumbnails or not.

There are some options about the cache in catalog/phpThumb/phpThumb.config.php (delete cached files based on age, size, nbr of files).

To increase speed, you can reduce the quality of the generated thumbnails (see config parameters). You have to check also other images, like on your home page, can you make them smaller.

- Chris
STS v4.5 SP5 is out, and check the STS Power Pack contribution too!
New thumbnailer using phpThumb: oscThumb. Works great.

#34   jeebus

jeebus
  • Members
  • 24 posts
  • Real Name:Dave

Posted 08 November 2007 - 02:00 PM

View Postrigadin2, on Nov 8 2007, 07:03 AM, said:

oscThumb has a cache feature. By default,  cached files are stored is in catalog/phpThumb/cache, this directory must be writeable. You can watch there if you have thumbnails or not.

There are some options about the cache in catalog/phpThumb/phpThumb.config.php (delete cached files based on age, size, nbr of files).

To increase speed, you can reduce the quality of the generated thumbnails (see config parameters). You have to check also other images, like on your home page, can you make them smaller.

- Chris


Thanks however, when I view the phpThumb/cache folder and there are about 20 folders with hundreds of sub folders. When I dig down through the 5 or 6 sub folders there's only 1 or two thumbnails in each. I've searched through a bunch of them and it's the same. Is this the way it should be?

#35   AndreD

AndreD
  • Members
  • 149 posts
  • Real Name:André Kjellstrup

Posted 13 November 2007 - 11:57 AM

is this addon ment to resize pictures for proper viewing as well (correct aspect ratio?)

thanks

#36   dominik3000

dominik3000
  • Members
  • 3 posts
  • Real Name:dh

Posted 13 November 2007 - 04:16 PM

hello,

i am using oscommerce 2.2rc1 with sts 4.5.3. i received the following errors after the install of this contribution:

Quote

Warning: chdir(): No such file or directory (errno 2) in D:\wwwroot\shop\includes\classes\oscthumb.php on line 273

Warning: main(includes/classes/message_stack.php): failed to open stream: No such file or directory in D:\wwwroot\shop\includes\application_top.php on line 514

Fatal error: main(): Failed opening required 'includes/classes/message_stack.php' (include_path='.;c:\php4\pear') in D:\wwwroot\shop\includes\application_top.php on line 514

any ideas what i do wrong?

thanks
dominik

#37   fmucar

fmucar
  • Members
  • 4 posts
  • Real Name:fatih mehmet ucar

Posted 13 November 2007 - 06:40 PM

View Postdominik3000, on Nov 13 2007, 06:16 PM, said:

hello,

i am using oscommerce 2.2rc1 with sts 4.5.3. i received the following errors after the install of this contribution:
any ideas what i do wrong?

thanks
dominik


can u see this file at this path?

D:\wwwroot\shop\includes\classes\oscthumb.php

#38   dominik3000

dominik3000
  • Members
  • 3 posts
  • Real Name:dh

Posted 13 November 2007 - 10:29 PM

View Postfmucar, on Nov 13 2007, 07:40 PM, said:

can u see this file at this path?

D:\wwwroot\shop\includes\classes\oscthumb.php

yes, i can...

#39   jeebus

jeebus
  • Members
  • 24 posts
  • Real Name:Dave

Posted 17 November 2007 - 09:31 PM

Alright I need some help, this one should be an easy one but I can't seem to figure out exactly what I should have here.

My thumbnails show up for comotorsports.net but they do not show up for www.comotorsports.net. I want them to show up for www.comotorsports.net as well as comotorsports.ca and www.comotorsports.ca

I believe I need to change it in the phpThumb.config file on this line....

$PHPTHUMB_CONFIG['nohotlink_valid_domains']	 = array(@$_SERVER['HTTP_HOST']);			// This is the list of domains for which thumbnails are allowed to be created. The default value of the current domain should be fine in most cases, but if neccesary you can add more domains in here, in the format 'www.example.com'


But I have no idea where to put them? I tried and tried and nothing worked.

The instructions seem easy in that line... but I just can't figure it out. Sorry if this is an absolute rediculous question.

Edited by jeebus, 17 November 2007 - 09:32 PM.


#40   arrowmodels

arrowmodels
  • Members
  • 25 posts
  • Real Name:Peter Muirhead

Posted 25 November 2007 - 08:54 PM

I am a relative novice so bear with me.

Installed and basically seems to be working although I haven't tested all features.  I mainly wanted it for the cached thumbnails.

After installation, I decided to disable Filename Encryption in Admin and none of my thumbnails were displayed and I got website error messages saying that the images could not be found. It seems that I need to clear out the cache or something before I make changes because it isn't dynamic. What is the recommended way to do this?  Is it just a case of directly deleting the cache files via ftp?

There also appears to be a problem when you change the user configuration section in catalog/phpThumb/phpThumb.config.php. Again I tried to amend the parameters in the cash culling section (line 52 onwards) but with no apparent affect.

I get the feeling that either it can only be set up before initial installation or I have to reset something before the changes take effect.

I also spotted an error in that line 60   $PHPTHUMB_CONFIG['cache_maxfiles'] = null;
should be commented out or the   $PHPTHUMB_CONFIG['cache_maxfiles'] = 200;
will never be actioned.

Thanks
Peter