Jump to content

[Resolved] Where is master_image size set?


Dirty Butter

Recommended Posts

I'm using a piece of code added to products.index.php that BSMITHER helped me with many versions ago. It adds the master_image to the image tab of the Admin Product Listing.

  	  <!-- MY MASTER IMAGE -->
         <div class="master_image">
            {$LANG.catalogue.image_main}:<br><br>
            <img src="{$PRODUCT.master_image}">
	  <br><br>

	  {$PRODUCT.master_image}
	  <!-- END MY MASTER IMAGE -->

My uploaded images are 600, which is large in the skin config.xml.

But the "MASTER" image is 200px, and the image name is always in the format

xxx/images/cache/XLDalmatianDogComfy.200.JPG

Is there something I can add to config.xml, so the master_image will be the original sharp 600?

 

 

 

Edited by Dirty Butter
Link to comment
Share on other sites

What version of CC6 did you implement this, and what version are running on now?

I ask because this "master_image" is incorporated in CC608 (I didn't check any earlier).

In /admin/sources/products.index.inc.php, near line 1180, there is:

$master_image = isset($_GET['product_id']) ? $GLOBALS['gui']->getProductImage((int)$_GET['product_id']) : '';
$result[0]['master_image'] =  !empty($master_image) ? $master_image : 'images/general/px.gif';

GUI->getProductImage() defaults to fetching the "small" size, which apparently is 200px on the longest side.

We can duplicate this to get the "large" size (600px?):

Add after:

$large_image = isset($_GET['product_id']) ? $GLOBALS['gui']->getProductImage((int)$_GET['product_id'], "large") : '';
$result[0]['large_image'] =  !empty($large_image) ? $large_image : 'images/general/px.gif';

Then, in the template, change {$PRODUCT.master_image} to {$PRODUCT.large_image}.

Now, if XLDalmatianDogComfy.600.JPG isn't crisp and sharp enough, we can try to add the URL that points to the actual source image.

And I hope you have enough screen real estate to show a 600px image.

Link to comment
Share on other sites

I have copies of that Master Image code going all the way back to 6.0.2 - didn't look further back. And I really remember you helping me with it originally. CC must have picked up the code.

Anyway, the source images are 600px wide, so your new code does give a crisp image with the detail I often need to easily distinguish one plush from another similar one.

As for screen real estate, I moved the whole Master Image code section in products.index.php to ABOVE the Filemanager box. That way it fits well on my Kindle in landscape and certainly not a problem on my computer.

THANK YOU!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...