Zen Cart Logo
Forums / All Other Contributions/Addons / Image Handler 2 (for ZC v1.3.8 ONLY) Support

Image Handler 2 (for ZC v1.3.8 ONLY) Support

Views: 2,510,530

Results 661 to 680 of 7,094
15 Nov 2006, 11:20 PM
#661
ryk avatar

ryk

Totally Zenned

Join Date:
Oct 2004
Location:
Southport, UK
Posts:
3,644
Plugin Contributions:
6

Image Handler 2 (for ZC v1.3.8 ONLY) Support

BRILLIANT!!

:clap:

Thank you - that's superb.

One possibility for improvement that you may be able to rattle off the top of your head, but which would take me hours of trial and error

Could it be made obvious that the attribute image is now a link? The mouse pointer doesn't change when rolled over.

15 Nov 2006, 11:44 PM
#662
colinr avatar

colinr

New Zenner

Join Date:
Jul 2006
Posts:
35
Plugin Contributions:
1

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

Ryk:

BRILLIANT!!

:clap:

Thank you - that's superb.

Cheers! :smile:

Ryk:

One possibility for improvement that you may be able to rattle off the top of your head, but which would take me hours of trial and error

Could it be made obvious that the attribute image is now a link? The mouse pointer doesn't change when rolled over.

/includes/templates/YOUR_TEMPLATES/css/stylesheet.css

attribImg { cursor: pointer; cursor: hand; }

...or...

attribImg img { cursor: pointer; cursor: hand; }

...ought to do it.

Alternatively:

$image = '<a href="javascript: popupWindow(\'http://YOUR_DOMAIN/index.php?main_page=popup_image&src='.zen_output_s tring($src).'\')"><img src="thumb.php?src=' . zen_output_string($src) . '&x=100&y=41&f=0" alt="' . zen_output_string($alt) . '"';

if (zen_not_null($alt)) {
$image .= ' title=" ' . zen_output_string($alt) . ' "';
}

if (zen_not_null($parameters)) $image .= ' ' . $parameters;

$image .= ' /></a>';

ColinR

16 Nov 2006, 12:12 AM
#663
ryk avatar

ryk

Totally Zenned

Join Date:
Oct 2004
Location:
Southport, UK
Posts:
3,644
Plugin Contributions:
6

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

colinr:

.attribImg img { cursor: pointer; cursor: hand; }

works for me.

I think this is worth packing up as a contribution. Do you want to do it, or shall I?

Incidentally, you can remove "http://YOUR_DOMAIN/" from javascript: popupWindow without any ill-effect - or so it seems!

16 Nov 2006, 9:00 AM
#664
thetankgirl avatar

thetankgirl

New Zenner

Join Date:
Jul 2005
Posts:
33
Plugin Contributions:
0

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

Because I had some problems with the zoom in, I tried to reinstall Image Handler, but now I get this error on my front-page:

Fatal error: imagepng() [<a href='function.imagepng'>function.imagepng</a>]: gd-png: fatal libpng error: zlib error in /opt/lampp/htdocs/zencartnieuw/includes/classes/bmz_image_handler.class.php on line 646

It's under the welcome message, the rest of the front page is normal.
Does anybody have a clue what this could be?

16 Nov 2006, 9:01 AM
#665
thetankgirl avatar

thetankgirl

New Zenner

Join Date:
Jul 2005
Posts:
33
Plugin Contributions:
0

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

Oh yeah, I'm using the newest version of xampp (for a while now). I had Image Handler working the first time on the same test-server.

16 Nov 2006, 9:55 AM
#666
colinr avatar

colinr

New Zenner

Join Date:
Jul 2006
Posts:
35
Plugin Contributions:
1

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

Hi Ryk,

Ryk:

works for me.

I think this is worth packing up as a contribution. Do you want to do it, or shall I?

If you're happy to lend a hand turning this into a downloadable contribution that would be great as I'm a bit short of time at the moment.

I've sent a message to the developer of the thumb.php script to see if I can include it in the package and will let you know. If not then a link in the installation instructions would do it - but naturally this could break at some point.

As this stuff is actually independent of IH2 we could extend it's use to improve the presentation of ALL images from an otherwise default ZenCart install.

It may also be possible to modify the core zen_image function(s) rather than creating a new zen_attribute_image function - but we'll need to look into this.

Ryk:

Incidentally, you can remove "http://YOUR_DOMAIN/" from javascript: popupWindow without any ill-effect - or so it seems!

Ok. I'm not sure if this would work for all browsers so to play it safe we can replace http://YOUR_DOMAIN/ with the base href variable. Should be easy enough.

ColinR

16 Nov 2006, 10:18 AM
#667
ryk avatar

ryk

Totally Zenned

Join Date:
Oct 2004
Location:
Southport, UK
Posts:
3,644
Plugin Contributions:
6

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

Check your PMs.

Re the domain ... only checked on FF & IE, but vaild point.

17 Nov 2006, 8:30 AM
#668
plumloopy avatar

plumloopy

New Zenner

Join Date:
Apr 2006
Posts:
66
Plugin Contributions:
0

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

Okay, it seems to work well except:

When rollover/popups are enabled, all my original 2nd, 3rd etc images are gone on the product page. No big deal, I didn't need this feature anyway.

HOWEVER:

When uploading an image for a product, I MUST select a "base name" (which says "optional") for it to upload all three sizes (otherwise they're all the same LARGE size). Subsequent uploads for the same product - additional images - do not require that I add the base name.

Is this how it's supposed to work? The "optional" tag makes me thing this is off just a bit.

Chris

17 Nov 2006, 1:16 PM
#669
hareslade avatar

hareslade

Totally Zenned

Join Date:
Nov 2004
Location:
U.K. South Wales
Posts:
442
Plugin Contributions:
0

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

Suggested code mod:
My image bmz cache was not clearing with the admin 'clear cache' link..

Referring to the suggestion in the php site..
http://uk.php.net/manual/en/class.dir.php

The line in v2's admin/includes/functions/extra_functions/ functions_bmz_io.php file, line 24 is

while ($file = $dir->read()) {

It sprang into life when I put

while (false !== ( $file = $dir->read() )  ) {

Am I right? btw the web server is a 4.4.4 php version

17 Nov 2006, 1:24 PM
#670
dandan avatar

dandan

New Zenner

Join Date:
Jul 2005
Posts:
7
Plugin Contributions:
0

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

When does Image Handler 2 (for Zen Cart 1.2x) create the small and medium versions of the image?

How does it know when a new image for a product has been uploaded (replacing an existing image or an entirely new image)?

What happens to existing small and medium images when you change the desired sizes of the small and medium images?

I'm asking because I want to make sure that the right images are available at all times.
I'm updating the Zen Cart database in batch from an external application (Microsoft Access database) and uploading the large pictures manually to the images directory.

Daniel

p.s. I hope it is ok to post in this thread? It seems there is no separate category on the forum for Image Handler.

17 Nov 2006, 2:22 PM
#671
hareslade avatar

hareslade

Totally Zenned

Join Date:
Nov 2004
Location:
U.K. South Wales
Posts:
442
Plugin Contributions:
0

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

I'm sure someone else knows, but I think the bmz functons automatically kick in when an image is requested from the cart-side page display. But also you can call up individual product images with the handler admin, and play around.

You can always clear the cache (specially if you use my mod above!) and see how it gets filled up after a cart-side page request.

Presumably if you change an image size setting, the old images named .image.(width)x (height) will be left in the cache folders, new ones of appropriate size will generate on the next page request.

So each cached image has its size as part of the long filename, so different sized images are created to suit, and are unique to a particular size.

If you want to know if the page is using cached images, look at the picture url, if its cached, it has 'bmz_cache' in the image 'src' url, as it comes from that cache folder.

Incidentally I think I've found a way of running the cache outside of web space, anyone interested, do p.m me. But it needs code changes.

17 Nov 2006, 5:03 PM
#672
mydanilo avatar

mydanilo

Totally Zenned

Join Date:
Dec 2004
Posts:
1,024
Plugin Contributions:
0

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

I have a strange problem. I upgraded to 1.3.6 and reinstalled the newest IH. All seemed to work. I took the time to delete the unneeded images in the small, large, medium directories in anticipation that IH will recreate the right sizes in the bmz_cache folder. I deleted the sub folders in bmz too just to make sure it will be recreated. Large versions of my pictures are now in the default images directory. As I understand everything should work now automatic. Well...it does for small and medium images, but when I click for a large pictures I get a fuzzy one. I look at the property and it shows way smaller file size then my original in the images folder. This particular large image does not to be calculated as it is 450x450 and my settings are set to max 500px. Path shows my image folder.

I don't understand what is going on but here is something interesting I found out. If I set image large max with to 440 (just 10px smaller then my original image) it gets generated in the bmz_cache folder and shows just fine!!! What is going on!

Btw with new uploaded images OTHER THAN THE SAME PICTURE NAME, everything works. I think somewhere something is cached? Maybe in the DB? I un-installed and re-installed IH in the admin. No better result. Pleas help.

17 Nov 2006, 5:05 PM
#673
mydanilo avatar

mydanilo

Totally Zenned

Join Date:
Dec 2004
Posts:
1,024
Plugin Contributions:
0

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

Just wanted to mention this is still a test site not the ones in my signature.
:)

17 Nov 2006, 5:47 PM
#674
mydanilo avatar

mydanilo

Totally Zenned

Join Date:
Dec 2004
Posts:
1,024
Plugin Contributions:
0

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

OK, I tried this now on my live site with one picture. I uploaded one large picture SP-02BR.jpg in my images directory with ftp. I deleted the corresponding pictures in small, large, medium folders. Now you can see what IH creates.

http://www.mydanilo.com/index.php?main_page=product_info&cPath=3_13&products_id=18

Medium image gets created correctly in bmz folder. Large image ( if we can believe the property dialog) gets taken from the /image folder. But look at the file size: 3.98kb. This is crap, the image IS in the image folder and is 66.3kb big.

Where is this wrong info stored? Why is this going wrong?

17 Nov 2006, 6:17 PM
#675
hareslade avatar

hareslade

Totally Zenned

Join Date:
Nov 2004
Location:
U.K. South Wales
Posts:
442
Plugin Contributions:
0

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

Hi mydanilo
was at your site page given, BUT I get the ordinary product (cached) image as 13k, the popup large image as 69k as you said, its a BIG 708 pixels.

So it seems to work ok?

Yes I agree what you said... if the 'real' uploaded image is less size over-all, than the 'large' size, IH does not touch it, you get the real image from /image folder.

This is presumably also done because yes, you can get reduced quality from a cached resize, so by uploading a suitably sized pic, you avoid IH caching of it..

You can up the cached pics compression quality in the images section admin, to 100, its 85 default.

Large image is the pop-up one. If the pop-up image is 'too big' then IH comes in and makes a reduced size cached version the right size for 'large'.

17 Nov 2006, 6:29 PM
#676
mydanilo avatar

mydanilo

Totally Zenned

Join Date:
Dec 2004
Posts:
1,024
Plugin Contributions:
0

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

Hi Hareslade,

I could shoot myself.....after the whole morning trying to figure this out, your reply triggered what is wrong. >>>> I HAD TO CLEAR THE CACHE OF MY BROWSER!!!!!

....and there.. it works! Thank you for testing it out for me.

And I thought the cache of the cart or some merging during upgrade or or.. but the closest possible thing I did not think of. WELL, I hope this will help somebody else at some point. Case closed.
:)

17 Nov 2006, 6:37 PM
#677
hareslade avatar

hareslade

Totally Zenned

Join Date:
Nov 2004
Location:
U.K. South Wales
Posts:
442
Plugin Contributions:
0

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

Please don't do yourself in:)
I find IE6 hangs on to locally cached images, Firefox is possibly better, and also Firefox always reads a changed css file, while IE6 ignores it usually.

17 Nov 2006, 8:09 PM
#678
mydanilo avatar

mydanilo

Totally Zenned

Join Date:
Dec 2004
Posts:
1,024
Plugin Contributions:
0

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

Well, I am using Firfox 2.0. Cache did not refresh itself. I had to do it manually. I think one could set it to clear every time the browser closes. Maybe a good idea...

20 Nov 2006, 4:22 AM
#679
aussiesapphire avatar

aussiesapphire

Zen Follower

Join Date:
Apr 2006
Posts:
114
Plugin Contributions:
0

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

Problem with Image Handler 2 - not sure what version is running but it suddenly stopped working. Consensus here seemed to be that my host changed something about the way they handle image files but I could not get any answer from them on specifics - is a unix server and I use c-panel for hosting admin.

Got it sort of working again by deleting a line in a file which referred to image magik (I think) - from a tip on this thread somewhere but now I cannot upload the main image directly from the product listing page - it appears to load but doesnt until I load up that item in image handler. The image which wont display on the web will then do so.

This is a right pain but at least is workable except that I want to now use the Document-General product type and I find that items of this product type will not display at all in Image Handler so my work around solution will not work if I choose that product type.

URL is https://www.aussiesapphire.com.au
example of problem item is
http://www.aussiesapphire.com.au/shop/index.php?main_page=document_general_info&cPath=17&products_id=283

any ideas on where to look for a solution
thanks
Leah

20 Nov 2006, 4:22 PM
#680
pytelcz avatar

pytelcz

New Zenner

Join Date:
Nov 2006
Posts:
4
Plugin Contributions:
0

Re: Image Handler 2 (for ZC v1.3.8 ONLY) Support

Don't know if someone post here how to deal with safe mode = "on" on server. If not i have a solution.
You must use ftp functions to create necessary directories.
You can use my code to do this. Just change variables (to connect to your ftp server), upload it and run.

<?php
$dir = "bmz_cache";
$ftp_address = "ftp.server.address"; // ftp.shop.com
$login = "login name to ftp server"; // mylogin
$password = "password to ftp server"; // mypassword
$yourpath = "path to your shop directory from ftp root"; // www/myshop

$conn_id = ftp_connect($ftp_address);
$login_result = ftp_login($conn_id, $login, $password);

if (ftp_chdir($conn_id, $yourpath)) {
   echo "Current directory is now: " . ftp_pwd($conn_id) . "\n<br>";
} else {
   echo "Couldn't change directory\n";
}

if (ftp_mkdir($conn_id, "bmz_cache")) {
 echo "successfully created bmz_cache\n<br>";
} else {
 echo "There was a problem while creating $dir\n";
}

ftp_chmod($conn_id, 0777, "bmz_cache");

if (ftp_chdir($conn_id, "bmz_cache")) {
   echo "Current directory is now: " . ftp_pwd($conn_id) . "\n<br>";
} else {
   echo "Couldn't change directory\n";
}

//will be good to add error handling :)
ftp_mkdir($conn_id, "1");
ftp_chmod($conn_id, 0777, "1");
ftp_mkdir($conn_id, "2");
ftp_chmod($conn_id, 0777, "2");
ftp_mkdir($conn_id, "3");
ftp_chmod($conn_id, 0777, "3");
ftp_mkdir($conn_id, "4");
ftp_chmod($conn_id, 0777, "4");
ftp_mkdir($conn_id, "5");
ftp_chmod($conn_id, 0777, "5");
ftp_mkdir($conn_id, "6");
ftp_chmod($conn_id, 0777, "6");
ftp_mkdir($conn_id, "7");
ftp_chmod($conn_id, 0777, "7");
ftp_mkdir($conn_id, "8");
ftp_chmod($conn_id, 0777, "8");
ftp_mkdir($conn_id, "9");
ftp_chmod($conn_id, 0777, "9");
ftp_mkdir($conn_id, "0");
ftp_chmod($conn_id, 0777, "0");
ftp_mkdir($conn_id, "a");
ftp_chmod($conn_id, 0777, "a");
ftp_mkdir($conn_id, "b");
ftp_chmod($conn_id, 0777, "b");
ftp_mkdir($conn_id, "c");
ftp_chmod($conn_id, 0777, "c");
ftp_mkdir($conn_id, "d");
ftp_chmod($conn_id, 0777, "d");
ftp_mkdir($conn_id, "e");
ftp_chmod($conn_id, 0777, "e");
ftp_mkdir($conn_id, "f");
ftp_chmod($conn_id, 0777, "f");

ftp_close($conn_id);
?>