If this is your first visit, check our documentation. To post, register or login.

Image Manager addon

Started by boudewijn on 15 Oct 2009, 8:13 AM · Views: 93,213

Results 201 to 220 of 284
3 Nov 2011, 4:20 AM
#201
boudewijn avatar

boudewijn

Zen Follower

Join Date:
Jun 2009
Posts:
207
Plugin Contributions:
0

Post #201 by boudewijn

billy565:

I've been using IM for over a year and I love it, but something new has come up. I can upload a product image through the new product form and see the original just fine. The problem appears when I make medium and large versions - the generated images have the wrong permissions and don't appear.

I've tested using my FTP program. I can see them appear with permissions of 600 and manually changing them to 644 makes everything work.

ZC v.1.3.9h, IM v.1.7, hosted at GoDaddy.

Any help, TIA.
Hi,

I couldn't say how to set the default or inherited rights for newly created files , as my knowledge of Nix is very limited. A simple solution may lay in that area.
However, we can try to fix it in the program.
Follow these steps:

  1. edit <admin>/includes/functions/extra_functions/function_image_manager.php
  2. Go to line 968, which reads: ```
    imagedestroy ($temp);
3. BEFORE that line, insert the following statement:```
chmod($dst, 0644);
  1. Save the file and upload it to your server

Please let me know if this fixes the problem.

Boudewijn

Boudewijn Sjouke
http://www.chinesedingen.nl

3 Nov 2011, 2:05 PM
#202
billy565 avatar

billy565

New Zenner

Join Date:
Nov 2011
Posts:
3
Plugin Contributions:
0

Post #202 by billy565

boudewijn:

Please let me know if this fixes the problem.

Thanks for the speedy reply! Yes, it fixed part of the problem. Now the new med/lrg images have the right permissions.

Any idea how to fix the re-uploading permissions? I looked at <admin>/image_manager_upload.php but it uses a different process.

Thanks again.

3 Nov 2011, 2:34 PM
#203
boudewijn avatar

boudewijn

Zen Follower

Join Date:
Jun 2009
Posts:
207
Plugin Contributions:
0

Post #203 by boudewijn

billy565:

Thanks for the speedy reply! Yes, it fixed part of the problem. Now the new med/lrg images have the right permissions.

Any idea how to fix the re-uploading permissions? I looked at <admin>/image_manager_upload.php but it uses a different process.

Thanks again.

In that file, insert after line 70, which reads: ```
$messageStack->add_session(IM_REPLACED . ' ' . DIR_FS_CATALOG_IMAGES . $p['dirname'] . '/' . $p['basename'], 'success');

the following line:```
chmod(DIR_FS_CATALOG_IMAGES . $p['dirname'] . '/' . $p['basename'], 0644);

and add after line 91, which reads: ```
$messageStack->add_session(IM_ADD_SUCCESS . ' ' . DIR_FS_CATALOG_IMAGES . $p['dirname'] . '/' . $p['filename'] . '_' . $_POST['IMsuffix'] . '.' . $p['extension'], 'success');

the following line: ```
chmod(DIR_FS_CATALOG_IMAGES . $p['dirname'] . '/' . $p['filename'] . '_' . $_POST['IMsuffix'] . '.' . $p['extension'], 0644);

They are fixes for both re-upload and add additional images.

Please let me know the results, as I cannot test it here.

Boudewijn

Boudewijn Sjouke
http://www.chinesedingen.nl

3 Nov 2011, 2:45 PM
#204
billy565 avatar

billy565

New Zenner

Join Date:
Nov 2011
Posts:
3
Plugin Contributions:
0

Post #204 by billy565

Perfect. Thanks!

I tested the re-upload function as well as the add additional image, plus the combined copy/shrink function. No issues.

Thanks again.

26 Nov 2011, 6:13 PM
#205
cmccreath avatar

cmccreath

New Zenner

Join Date:
Nov 2008
Posts:
3
Plugin Contributions:
0

Post #205 by cmccreath

Hi
Just downloaded version 1.8. First time installation on Zencart 1.38a.
I've downloaded the zip file twice from the Zencart site, but neither contain an "install.sql" or "uninstall.sql". Maybe I'm just misreading the instructions......

26 Nov 2011, 8:34 PM
#206
boudewijn avatar

boudewijn

Zen Follower

Join Date:
Jun 2009
Posts:
207
Plugin Contributions:
0

Post #206 by boudewijn

cmccreath:

Hi
Just downloaded version 1.8. First time installation on Zencart 1.38a.
I've downloaded the zip file twice from the Zencart site, but neither contain an "install.sql" or "uninstall.sql". Maybe I'm just misreading the instructions......

Hi,

No, you are right. The instructions should have read "install_zc_1.3.sql" and "uninstall_zc_1.3.sql". I will correct the instructions in the next version. Thanks for mentioning this.

Boudewijn

Boudewijn Sjouke
http://www.chinesedingen.nl

27 Nov 2011, 4:03 AM
#207
gothstone avatar

gothstone

Zen Follower

Join Date:
Jun 2005
Posts:
330
Plugin Contributions:
0

Post #207 by gothstone

I'm working on updating to zencart 1.5 and switching to image manager from image handler at the same time. There seems be a logic flaw in listing files with errors. Heres the secario to recreate: My large image size is set to 750x550. I upload an immage thats 768x1024 (portrait instead of landscape). It creates the large image at 413x550 as it should. It then lists the image as an error, presumably because its undersized width wise.

Aditionaly, on some occasions I would upload a file smaller (both height and width) than the large image size. It will not create the large image. That makes sence, but it always shows as an error, so I can't use autofix to resize the rest.

2 + 2 = 5 for extremely large values of 2

Pez Collectors Store •••••••• My Plugins List

27 Nov 2011, 4:31 AM
#208
gothstone avatar

gothstone

Zen Follower

Join Date:
Jun 2005
Posts:
330
Plugin Contributions:
0

Post #208 by gothstone

The best aproach might be to make autofix run what actions it can, but skip the actions it can't handle. It get "hung up" on images that have a height or width less than the max size.

2 + 2 = 5 for extremely large values of 2

Pez Collectors Store •••••••• My Plugins List

27 Nov 2011, 7:27 AM
#209
gothstone avatar

gothstone

Zen Follower

Join Date:
Jun 2005
Posts:
330
Plugin Contributions:
0

Post #209 by gothstone

Ok, I found the heart of my issues, and some crappy workarounds. Mabey tomorrow I will be awake enough to actualy fix them. For now, heres what I have:

Function_image_manager.php
lines 337-341
This code check the size of the large image agains the max medium image size. If all my images were the same proportions this would be great. Unfortunately if my max medium is 300x240 and my origional image is 600x229 I'm SOL.
What I want is a large image of 600x229, a medium of 300x114 and a small of 145x55
To hack this for now I change the || on line 341 to &&
The real way to handel this would be to compare to the actual size of the created medium image. Of course first we would have to make sure it exists and get it size, or if it doesn't exist, make sure it could resize and calculate what size it would be. Ugg.

lines 500-507
This currently compares the small image to the max medium image width. Same problems as above. Solution is to replace line 503 with this: if ($image["small"]["width"] > IM_MAX_LARGE_WIDTH || $image["small"]["height"] > IM_MAX_LARGE_HEIGHT) {
Thats sorta works for now, but it needs a secondary check to make sure the large image will be larger than the medium image.

2 + 2 = 5 for extremely large values of 2

Pez Collectors Store •••••••• My Plugins List

5 Dec 2011, 9:30 AM
#210
boudewijn avatar

boudewijn

Zen Follower

Join Date:
Jun 2009
Posts:
207
Plugin Contributions:
0

Post #210 by boudewijn

gothstone:

Ok, I found the heart of my issues, and some crappy workarounds. Mabey tomorrow I will be awake enough to actualy fix them. For now, heres what I have:

Function_image_manager.php
lines 337-341
This code check the size of the large image agains the max medium image size. If all my images were the same proportions this would be great. Unfortunately if my max medium is 300x240 and my origional image is 600x229 I'm SOL.
What I want is a large image of 600x229, a medium of 300x114 and a small of 145x55
To hack this for now I change the || on line 341 to &&
The real way to handel this would be to compare to the actual size of the created medium image. Of course first we would have to make sure it exists and get it size, or if it doesn't exist, make sure it could resize and calculate what size it would be. Ugg.

lines 500-507
This currently compares the small image to the max medium image width. Same problems as above. Solution is to replace line 503 with this: if ($image["small"]["width"] > IM_MAX_LARGE_WIDTH || $image["small"]["height"] > IM_MAX_LARGE_HEIGHT) {
Thats sorta works for now, but it needs a secondary check to make sure the large image will be larger than the medium image.

I am aware that it's by design that both dimensions must meet the defined minima. But I can also make this an option (choice OR or AND). Or, to go to the bottom, 3 choices: height, or width, or both must meet the minimum. What do you think?

Boudewijn Sjouke
http://www.chinesedingen.nl

18 Dec 2011, 3:54 PM
#211
manor avatar

manor

New Zenner

Join Date:
May 2008
Posts:
42
Plugin Contributions:
0

Post #211 by manor

Hello

I've uploaded all the files and get the manager to appear in the admin however no images are showing, I'm running 1.3.9.

Chris

19 Dec 2011, 6:00 AM
#212
boudewijn avatar

boudewijn

Zen Follower

Join Date:
Jun 2009
Posts:
207
Plugin Contributions:
0

Post #212 by boudewijn

Manor:

Hello

I've uploaded all the files and get the manager to appear in the admin however no images are showing, I'm running 1.3.9.

Chris
Hi Chris,

What options are selected?

Boudewijn Sjouke
http://www.chinesedingen.nl

30 Jan 2012, 1:02 AM
#213
danielle avatar

danielle

Totally Zenned

Join Date:
Oct 2004
Posts:
973
Plugin Contributions:
0

Post #213 by danielle

Hi there, I installed the newest version of this mod on a 1.5.0 store as it says it is compatible, but no links show up in the admin. Is there something I need to do that is not listed in the mod readme file? Thank you!

Danielle

30 Jan 2012, 7:39 AM
#214
boudewijn avatar

boudewijn

Zen Follower

Join Date:
Jun 2009
Posts:
207
Plugin Contributions:
0

Post #214 by boudewijn

Danielle:

Hi there, I installed the newest version of this mod on a 1.5.0 store as it says it is compatible, but no links show up in the admin. Is there something I need to do that is not listed in the mod readme file? Thank you!

Did you run install_zc_1.5.sql?
Are you using other admin profiles than superuser?

Boudewijn Sjouke
http://www.chinesedingen.nl

30 Jan 2012, 3:55 PM
#215
danielle avatar

danielle

Totally Zenned

Join Date:
Oct 2004
Posts:
973
Plugin Contributions:
0

Post #215 by danielle

boudewijn:

Did you run install_zc_1.5.sql?
Are you using other admin profiles than superuser?

Yes, I ran the 1.5 sql, and no, there are two superusers set up, but nothing else.

Danielle

2 Feb 2012, 5:45 AM
#216
friedrich72 avatar

friedrich72

New Zenner

Join Date:
May 2009
Location:
Kansas
Posts:
39
Plugin Contributions:
0

Post #216 by friedrich72

Hello. I am having the same issue with the 1.5 install.
I am not seeing any links in the admin.

SQL patch went ok. Transferred files with Filezilla.

I upgraded from 1.3.8 and had IH2 running.
Any advice would be great.

2 Feb 2012, 8:39 AM
#217
boudewijn avatar

boudewijn

Zen Follower

Join Date:
Jun 2009
Posts:
207
Plugin Contributions:
0

Post #217 by boudewijn

Friedrich72:

Hello. I am having the same issue with the 1.5 install.
I am not seeing any links in the admin.

SQL patch went ok. Transferred files with Filezilla.

I upgraded from 1.3.8 and had IH2 running.
Any advice would be great.

Did you check if all files are uploaded properly and placed in the right folders? The structure must be copied to the admin folder, not to the webroot.

Is IM visible in the configuration menu?

Boudewijn Sjouke
http://www.chinesedingen.nl

2 Feb 2012, 8:05 PM
#218
friedrich72 avatar

friedrich72

New Zenner

Join Date:
May 2009
Location:
Kansas
Posts:
39
Plugin Contributions:
0

Post #218 by friedrich72

Thank you for the response.
You are correct! In my haste, I missed the instruction to load it to the admin!
If you do an update on IM, maybe, for hasty people like me, you can make the folder structure indicate that it is to go into "admin".:smile:

I had another conflict with 1.5 on a separate issue so I ended up reverting to 1.3.9h. Unfortunately I didnt get to see IM in action.

2 Feb 2012, 9:55 PM
#219
boudewijn avatar

boudewijn

Zen Follower

Join Date:
Jun 2009
Posts:
207
Plugin Contributions:
0

Post #219 by boudewijn

Friedrich72:

Thank you for the response.
You are correct! In my haste, I missed the instruction to load it to the admin!
If you do an update on IM, maybe, for hasty people like me, you can make the folder structure indicate that it is to go into "admin".:smile:

I had another conflict with 1.5 on a separate issue so I ended up reverting to 1.3.9h. Unfortunately I didnt get to see IM in action.

Thanks for your reply. I will change this in the next release of IM.
If you want to see IM in action, you can also install it on 1.3.9h........

Boudewijn Sjouke
http://www.chinesedingen.nl

16 Feb 2012, 1:42 AM
#220
rrgreene avatar

rrgreene

New Zenner

Join Date:
Feb 2012
Posts:
3
Plugin Contributions:
0

Post #220 by rrgreene

I get the following error when I try to auto fix or copy/resize:

PHP Fatal error: 1062:Duplicate entry 'ConfigImageManager' for key 'page_key' :: INSERT INTO admin_pages (page_key, language_key, main_page, page_params, menu_key, display_on_menu, sort_order) VALUES ('ConfigImageManager', 'BOX_TOOLS_IMAGE_MANAGER', 'FILENAME_CONFIGURATION', CONCAT('gID=', @configuration_group_id), 'configuration', 'Y', @sort_order);

Any ideas?

Zen Cart 1.5 and Image Manager 1.8
Nothing changed or upgraded since this last worked.