Forums / Addon Admin Tools / Image Manager addon

Image Manager addon

Views: 93,066

Results 281 to 284 of 284
23 May 2014, 7:47 PM
#281
tonibarcelona avatar

tonibarcelona

Inactive

Join Date:
Feb 2007
Location:
Barcelona
Posts:
200
Plugin Contributions:
0

Image Manager addon

After working on the mod, I think, what is the subject for saving the original image at server if you can´t acces to it if you want to restore?
Question for Boudewijn, isn´t possible to add a link for restore the original image like the link for re-upload?

30 Nov 2014, 8:08 AM
#282
eavinu avatar

eavinu

New Zenner

Join Date:
Jan 2009
Posts:
37
Plugin Contributions:
0

Re: Image Manager addon

Hello Boudewijn and everyone else on this thread.

I found a small problem that had to be resolved for my purposes, maybe this can help you all and Boudewijn maybe you can add it to the next version if you think it is an improvement.
First I'll mention that on this specific website I am using 1.3.9h and IM 1.9.

My problem was that when there is no large image and the original image is smaller than the Maximum definition for large images on the IM settings, the large image that is being created is according to the Maximum definitions and in this case where the original is smaller it is actually not necessary and I prefer that it will take the properties from the original image for Large and shrink for Small/Medium.

The fix:
in admin/includes/functions/extra_functions/function_image_manager.php around line 888 locate this code:

	else if ($dst_type == "large") {
		$cw = $org_w / IM_MAX_LARGE_WIDTH;
		$ch = $org_h / IM_MAX_LARGE_HEIGHT;
		if ($cw > $ch) {
			$dst_w = IM_MAX_LARGE_WIDTH;
			$dst_h = round($org_h / $cw);
		} 
		else {
			$dst_h = IM_MAX_LARGE_HEIGHT;
			$dst_w = round($org_w / $ch);
		}
	}

replace with this code:

	else if ($dst_type == "large") {
		$cw = $org_w / IM_MAX_LARGE_WIDTH;
		$ch = $org_h / IM_MAX_LARGE_HEIGHT;
		if ($cw > 1 || $ch > 1) {		
			if ($cw > $ch) {
				$dst_w = IM_MAX_LARGE_WIDTH;
				$dst_h = round($org_h / $cw);
			}
			else {
				$dst_h = IM_MAX_LARGE_HEIGHT;
				$dst_w = round($org_w / $ch);
			}
		} else {
			$dst_w = $org_w;
			$dst_h = $org_h;
		}
	}

Boudewijn let me know what you think.

Eran

18 Jul 2019, 11:20 AM
#283
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,720
Plugin Contributions:
56

Re: Image Manager addon

What's the status of this mod? Looks like you get a duplicate parameter error in admin/includes/functions/extra_functions/function_image_manager.php line 89 in more recent versions of PHP.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

17 Jun 2021, 10:44 AM
#284
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Image Manager addon

I've got Image Manager 2.1 running on 1.57c...

I've got a bunch more updating to do before it will be ready for release but things are looking good!

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian