Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * * * 3 votes

[Contribution] oscThumb


430 replies to this topic

#181 rmalzahn

  • Community Member
  • 6 posts
  • Real Name:Richard Malzahn

Posted 27 September 2009, 03:55

My thumbnail not displaying is fixed.
I when through all 1600 of my images and found several that were in cymk mode, so I changed them to RGB, along with reducing images sizes to no more than 2500x2500 pixels.
This fixed my problem.

#182 spooks

  • Community Member
  • 6,668 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 02 October 2009, 10:48

This has been raised in one of my threads, so I thought I would repeat it here, in the hope that someone familier with the osCthumb code can find a solution.

osCthumb only watermarks popup images that are passed through popup_image.php which is only called (on an unmodified store) by the javascript popup function, that means all thats needed to get a non-watermarked image is to disable javascript in the browser!! :huh:

Would it be possible to watermark all popup images, regardless of the calling page? :)
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Post osC questions don't PM them. Vampire?

Contributions:

Multi Images with Fancy Popups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#183 azer

  • Community Member
  • 842 posts
  • Real Name:azer
  • Location:Paris, france

Posted 02 October 2009, 15:53

View Postspooks, on Oct 2 2009, 12:48 PM, said:

This has been raised in one of my threads, so I thought I would repeat it here, in the hope that someone familier with the osCthumb code can find a solution.

osCthumb only watermarks popup images that are passed through popup_image.php which is only called (on an unmodified store) by the javascript popup function, that means all thats needed to get a non-watermarked image is to disable javascript in the browser!! :huh:

Would it be possible to watermark all popup images, regardless of the calling page? :)

i tought oscthumb know an image to process because of the size (diemnsions) of it that correspond to the one set in configuration ... and if it s has a code that checkthe calling page we should just check if we can override it, but most important is the way popup image is called:
echo '<a  rel="image_group" title="'.$product_info['products_name'].'" href="' .[b] tep_href_link(DIR_WS_IMAGES . $value)[/b] . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $value, $product_info['products_name'], TINY_IMAGE_WIDTH, TINY_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br />' . '</a>';

the big popu image is called by a link , not a tep_image so oscthmb would not be used because of that

what do you think ?
MS2

#184 spooks

  • Community Member
  • 6,668 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 02 October 2009, 16:52

Watermarks with scripts disabled:

You're right azer, I did'nt look close enough at the code (it was a very late night/morning last night!!) :blush:

This is my solution for an unmodified product_info.php

find(112):

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

replace with:

<?php if (class_exists('oscthumb') && CFG_MASTER_SWITCH == 'On') { preg_match('/"([^"]+)"/',htmlentities ( tep_image(DIR_WS_IMAGES . $product_info['products_image'],'','','','','',5), ENT_NOQUOTES), $image);  $source=str_replace('&amp;','&',$image[1]); } else { $source = DIR_WS_IMAGES . $product_info['products_image']; }
  echo '<a href="' . tep_href_link($source) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

you could apply the same to product_reviews etc. :)
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Post osC questions don't PM them. Vampire?

Contributions:

Multi Images with Fancy Popups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#185 spooks

  • Community Member
  • 6,668 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 03 October 2009, 20:18

Watermarks with scripts disabled:

There is a bug the code I posted last, if the image is not on the server & image required is set to false a unable to determine page link error will occur, to fix use the following:


This is my updated solution for an unmodified product_info.php

find(112):



replace with:



you could apply the same to product_reviews etc. :)


[/quote]
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Post osC questions don't PM them. Vampire?

Contributions:

Multi Images with Fancy Popups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#186 spooks

  • Community Member
  • 6,668 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 04 October 2009, 20:26

I have a new issue with this, I hope someone can provide a solution.

Using this with FancyBox popups there is problem if filename encryption is used, as the image extension is also encrypted FancyBox will not recognise the file as an image.

Can the image extension remain un-encrypted, or a flag added to the url to indicate the extension?
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Post osC questions don't PM them. Vampire?

Contributions:

Multi Images with Fancy Popups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#187 sugarsnow

  • Community Member
  • 12 posts
  • Real Name:Sugar

Posted 05 October 2009, 04:55

I was wanting to try out this contrib but spybot snd is saying the zip files have Eblaster threats for both downloads of version 1.1.1 and oscThumb 1.1 :(
Anyone else getting this?

#188 spooks

  • Community Member
  • 6,668 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 05 October 2009, 09:26

View Postsugarsnow, on 05 October 2009, 04:55, said:

I was wanting to try out this contrib but spybot snd is saying the zip files have Eblaster threats for both downloads of version 1.1.1 and oscThumb 1.1 [img]http://forums.oscommerce.com/public/style_emoticons/default/sad.gif[/img]
Anyone else getting this?

My version of spybot does not report any issue, niether does kaspersky!!
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Post osC questions don't PM them. Vampire?

Contributions:

Multi Images with Fancy Popups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#189 sugarsnow

  • Community Member
  • 12 posts
  • Real Name:Sugar

Posted 05 October 2009, 22:03

View Postspooks, on 05 October 2009, 09:26, said:

My version of spybot does not report any issue, niether does kaspersky!!

I decided to try again with the file uploaded yesterday oscThumb 1.1.2 and that one scans clean :) thanks for uploading looking forward to giving this contrib a try

#190 pedro.antunes

  • Community Member
  • 41 posts
  • Real Name:pedro
  • Gender:Male

Posted 05 October 2009, 22:42

Hi,

I have a problem with my installation, and I did not find anyone complaining about it yet.
I installed oscThumb on both my local installation (using WAMP) and to my server without any major problems. Except that not all thumbnails appear (on both installations)... The source image is present because if I disable the contribution it appears. The thumbnails are missing from the products list and also from the products info page, but when I click on the link to enlarge the full size image appears.
The problem seems to be related with the encryption because when I change the encription key the missing thumbnail appears but some others, somewhere, disappears.
I was not able to find a link between the encription key and the missing images. I did not find a link between the parameters sent to oscthumb.php in the link and the file name and/or path in cache folder to see if the picture was created or not.

I need to debug this issue, but I don't know where to start. I think a good starting point is to see the if the generated file name for the cache is really created or not, but how can I do that and where?
Can someone help?

Br
Pedro

#191 spooks

  • Community Member
  • 6,668 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 05 October 2009, 23:01

can u make it clear what settings your using & if error occurs in both firefox & ie
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Post osC questions don't PM them. Vampire?

Contributions:

Multi Images with Fancy Popups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#192 pedro.antunes

  • Community Member
  • 41 posts
  • Real Name:pedro
  • Gender:Male

Posted 05 October 2009, 23:21

View Postspooks, on 05 October 2009, 23:01, said:

can u make it clear what settings your using & if error occurs in both firefox & ie
I don't know if the question is for me or not, but here it goes anyway...
I have the problem in both Firefox 3.5 and IE8. And it happens with both GIF and JPG images. Some categories images also suffer from this strange disapearement.
For the oscThumbs settings I have:
- master switch=on
- Process Store's Graphics =False
- Encrypt Image Filenames =True
- a string with capital and small letters and spaces as the encryption key
- Output GIFs as JPEGs = False
- Use Zoom Crop? = False
- JPEG Quality = 95 for all
no image or text wattermarks, but if I activete them it still has the issue
all the other settings are the default ones

Thanks for the help!

#193 pedro.antunes

  • Community Member
  • 41 posts
  • Real Name:pedro
  • Gender:Male

Posted 07 October 2009, 09:35

Does anyone have ideas where to start?
I don't need that anyone does it for me, I just need some ideas where to start. I tried to use the echo command as in most of my debugging but it does not show anything in most of the files (form class and oscThumb folders). Is there any other way to show messages from these files?
Please note that I'm not a php expert, but I can easily understand the code to try to fix it.

Br,
Pedro

#194 spooks

  • Community Member
  • 6,668 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 07 October 2009, 10:09

encription causes missing thumbnail images

View Postpedro.antunes, on 07 October 2009, 09:35, said:



I have been able to duplicate this to an extent.

It would appear the issue is due to the encryption removing the file extension, causing problems identifying file type.

I do not have any solution to date.
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Post osC questions don't PM them. Vampire?

Contributions:

Multi Images with Fancy Popups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#195 pedro.antunes

  • Community Member
  • 41 posts
  • Real Name:pedro
  • Gender:Male

Posted 07 October 2009, 13:45

View Postspooks, on 07 October 2009, 10:09, said:

encription causes missing thumbnail images



I have been able to duplicate this to an extent.

It would appear the issue is due to the encryption removing the file extension, causing problems identifying file type.

I do not have any solution to date.

Thanks for the information!
I thinks it's a weird behaviour because most thumbnails work, and I guess the file extension is removed from all of them, so the question that remains is why if the extension is removed some thumbnails appear and some others don't. Even weider is that the small thumbnails that are missing, we can see the larger picture from the Product Info.

I checked also the forum of phpThumb (where oscThumbs is based on) and I saw no one complaining on this...

Do you know if there is a rule on defining the encryption key (characters that can't be used, characters that should always be used, etc.)?

Br,
Pedro

#196 netpox

  • Community Member
  • 23 posts
  • Real Name:Audu

Posted 07 October 2009, 16:36

I installed oscThumb and everything looks and works great...only thing is that when it processes the image and then when the new image from oscThumb displays its on #FCFEFC background. All of my images were on #FFFFFF background when i uploaded them. Now if you closely look you can see that it doesnt fit in how i would like it on my page. Where can i change that?

#197 bobeisenberg

  • Community Member
  • 45 posts
  • Real Name:Bob Eisenberg
  • Location:Chelmsford, England

Posted 11 October 2009, 08:37

I have recently added the oscThumb contribution, but cannot get it to work. The problem seems to be caused by the application_top.php file:

I have manually edited it, by adding the following code as instructed:

"// START oscThumb
require(DIR_WS_CLASSES . 'oscthumb.php');
$oscthumb = new oscthumb;
$oscthumb->check_hash(); // Check if parameters have changed. Delete cache if yes.
// END oscThumb"

immediately before

"// initialize the message stack for output messages
require(DIR_WS_CLASSES . 'message_stack.php');
$messageStack = new messageStack;"


When I do this, I get the following message on my site (and just a white screen with nothing else on it):


"phpThumb() v1.7.7-200612252166

ERROR: missing hash"


Can anyone suggest what I should do?

Many thanks.

Bob

#198 spooks

  • Community Member
  • 6,668 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 11 October 2009, 08:56

View Postbobeisenberg, on 11 October 2009, 08:37, said:



Check your install again, tips given here may help.
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Post osC questions don't PM them. Vampire?

Contributions:

Multi Images with Fancy Popups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#199 axioma

  • Community Member
  • 154 posts
  • Real Name:yesid borislov

Posted 12 October 2009, 22:49

HERE it says that the folder "you have to make the cache directory writeable (CHMOD 777)"
this is not dangerous for the security of my site, you know hackers and so on.

#200 pedro.antunes

  • Community Member
  • 41 posts
  • Real Name:pedro
  • Gender:Male

Posted 13 October 2009, 22:19

Found another bug:

When you choose to have a watermark on the image, even in encrypted mode, if you grab the image location and remove the watermark part, the image is displayed in it's original form, so I guess there is no validation of the hash part of the link.
Exampe:
http://localhost/loja/oscthumb.php?src=lqrhxtPO2KHP1tDX1Kbj5ZTUz7_d1crR1qbnlNnKydfI1sKiy6jj5MbS04He4tA.&w=160&h=160&fltr[]=wmi|/phpThumb/watermarks/car.png|C|75|0&f=jpg&q=95&hash=7a0c683ed6fb47e15f946eaeef3f6c66
shows a picture with a watermark but if you remove &fltr[]=wmi|/phpThumb/watermarks/car.png|C|75|0 the original image is shown at the specified size without the watermark and without any error.

There is the same behavior if you change the width and height settings.

Is it a bug or a bad setting on my configuration? There are no encrypted examples on phpThumb() source page to test.

Does someone knows of another good contribution to create thumbnails and watermarks that works?

Regards

Edited by pedro.antunes, 13 October 2009, 22:19.