Jump to content
Sign in to follow this  
Parikesit

[Contribution] Additional Images Module

Recommended Posts

should look like this:

 

Small Image Width 100

Small Image Height

Heading Image Width 57

Heading Image Height 40

Subcategory Image Width 100

Subcategory Image Height 57

Calculate Image Size true

Image Required true

Display Image Width 200

Display Image Height

Popup Image Width 400

Popup Image Height

Yes, any idea in which file or database table I should look to eliminate those tripled values??

 

Cheers.

Share this post


Link to post
Share on other sites

Yes, any idea in which file or database table I should look to eliminate those tripled values??

 

Cheers.

 

The easiest way would be to use phpMyAdmin if your host offers it. They are in the "configuration" table. Probably at the end of it. With phpMyAdmin you can browse the entries in the table, page to the end of it and remove any that have a duplicate name in the configuration_key. hope that help. There should never be a duplicate configuration_key in that table

Share this post


Link to post
Share on other sites

Hi,

 

Has anyone managed to fuse jquery's PrettyPhoto [lightbox clone] with the Additional Images Module.

 

PrettyPhoto is much more powerful that the prototype - Lightbox you can view prettyPhoto here

 

I am looking into merging such, but have no idea where to start... my cart uses jquery

 

Regs

 

not at this time. the licensing for any package to be included in contributions here must be GPL. Although Creative Commons Attribution 2.5 allows you to use it in a similar way, it may not be a compatible licensing. See "contributions" under the forum rules link above.

Share this post


Link to post
Share on other sites

what version are you using?

 

Using: v2.2 RC2a of the osCommerce and 2.2.0 of this contrib

 

I'm not sure my previous explanation said as I wanted it to. When I upload the image now and refresh the product info page, the visible image is the correct size specified within my admin section. BUT there is a whole section of white space (the dimensions of the original image uploaded) and the resized image is shown in the middle. If I then mouse over the other images and go back to the resized parent image.. this now is shown in full size and takes up the whole space.. which is a bit of a dilema!

Share this post


Link to post
Share on other sites

Using: v2.2 RC2a of the osCommerce and 2.2.0 of this contrib

 

I'm not sure my previous explanation said as I wanted it to. When I upload the image now and refresh the product info page, the visible image is the correct size specified within my admin section. BUT there is a whole section of white space (the dimensions of the original image uploaded) and the resized image is shown in the middle. If I then mouse over the other images and go back to the resized parent image.. this now is shown in full size and takes up the whole space.. which is a bit of a dilema!

 

PM a link to the page please

Share this post


Link to post
Share on other sites

The easiest way would be to use phpMyAdmin if your host offers it. They are in the "configuration" table. Probably at the end of it. With phpMyAdmin you can browse the entries in the table, page to the end of it and remove any that have a duplicate name in the configuration_key. hope that help. There should never be a duplicate configuration_key in that table

Jackpot! Thanks a lot man, you saved my day! :thumbsup:

 

Cheers.

Share this post


Link to post
Share on other sites

Hello,

 

I don't know if this is possible bug related to watermark function. I'm using Background color functionality because it makes images proportional with fixed size. But if using with watermark function, watermark is shifting its position depending on the source image size. That is spoiling whole idea of having fixed images size with 'Background color' function.

 

My suggestion is to revert the processing process. Let 'Background color' come first, then watermark position will be all the same on images that uses calculated 'Background color'.

 

Thanks?

 

Cheers.

Share this post


Link to post
Share on other sites

Hello,

 

I don't know if this is possible bug related to watermark function. I'm using Background color functionality because it makes images proportional with fixed size. But if using with watermark function, watermark is shifting its position depending on the source image size. That is spoiling whole idea of having fixed images size with 'Background color' function.

 

My suggestion is to revert the processing process. Let 'Background color' come first, then watermark position will be all the same on images that uses calculated 'Background color'.

 

Thanks?

 

Cheers.

OK, try these changes to \admin\includes\classes\alterimage.php

 

find:
var $config_disable_imagecopyresampled = false;
add after:
var $skip_watermark = false;

find:
	if (!empty($maxheight)) { $this->max_height = $maxheight; }
add after:
	$this->skip_watermark = (ADDIMAGES_ADD_WATERMARK == 'false' ? true : $skip_watermark);

find:
	if (!$skip_watermark) { $this->addWatermark(ADDIMAGES_WATERMARK_TRANSPARENCY); }
remove the line.

find:
	$this->ApplyBackground();
add after:
	if (!$this->skip_watermark) { $this->addWatermark(ADDIMAGES_WATERMARK_TRANSPARENCY); }

Share this post


Link to post
Share on other sites

not at this time. the licensing for any package to be included in contributions here must be GPL. Although Creative Commons Attribution 2.5 allows you to use it in a similar way, it may not be a compatible licensing. See "contributions" under the forum rules link above.

 

It has been used already in the contrib Simple Multi Image Add-on Plus PrettyPhoto

 

I think it could be done... Grasping the power of AI and this, ;) [the sky the limit]

 

I would do it but need help as to which areas I should focus on...

 

Regs Proimage

Share this post


Link to post
Share on other sites

OK, try these changes to \admin\includes\classes\alterimage.php

 

find:
var $config_disable_imagecopyresampled = false;
add after:
var $skip_watermark = false;

find:
	if (!empty($maxheight)) { $this->max_height = $maxheight; }
add after:
	$this->skip_watermark = (ADDIMAGES_ADD_WATERMARK == 'false' ? true : $skip_watermark);

find:
	if (!$skip_watermark) { $this->addWatermark(ADDIMAGES_WATERMARK_TRANSPARENCY); }
remove the line.

find:
	$this->ApplyBackground();
add after:
	if (!$this->skip_watermark) { $this->addWatermark(ADDIMAGES_WATERMARK_TRANSPARENCY); }

I have tried but it is the same result as before. Watermark is 'jumping' around depending on source image size...

 

Cheers.

Share this post


Link to post
Share on other sites

I have tried but it is the same result as before. Watermark is 'jumping' around depending on source image size...

 

Cheers.

 

works for me, double check your work.

Share this post


Link to post
Share on other sites

works for me, double check your work.

Hi,I have checked and done per your instructions. Just tell me, shall

 

$skip_watermark = (ADDIMAGES_ADD_WATERMARK == 'false' ? true : $skip_watermark);

 

not be deleted because we added

 

$this->skip_watermark = (ADDIMAGES_ADD_WATERMARK == 'false' ? true : $skip_watermark);

 

Maybe this causing the problem?

 

My setting as following:

 

Watermark: Add watermark to images true Info

Watermark: Watermark image file watermark.png Info

Watermark: Opacity 50 Info

Watermark: Skip thumbnail true Info

Watermark: Horizontal alignment right Info

Watermark: Vertical alignment bottom Info

Watermark: Watermark image offset (as a percent) 10 Info

Product Info: Parent product image alignment center Info

 

I will appreciate if you could send over your file version so that I can replace mine with. Thanks.

 

Cheers.

Edited by WorkingHard

Share this post


Link to post
Share on other sites

Hi,I have checked and done per your instructions. Just tell me, shall

 

$skip_watermark = (ADDIMAGES_ADD_WATERMARK == 'false' ? true : $skip_watermark);

 

not be deleted because we added

 

$this->skip_watermark = (ADDIMAGES_ADD_WATERMARK == 'false' ? true : $skip_watermark);

 

Maybe this causing the problem?

 

My setting as following:

 

Watermark: Add watermark to images true Info

Watermark: Watermark image file watermark.png Info

Watermark: Opacity 50 Info

Watermark: Skip thumbnail true Info

Watermark: Horizontal alignment right Info

Watermark: Vertical alignment bottom Info

Watermark: Watermark image offset (as a percent) 10 Info

Product Info: Parent product image alignment center Info

 

I will appreciate if you could send over your file version so that I can replace mine with. Thanks.

 

Cheers.

 

if you don't remove the line suggested in the update instructions, it will continue to add the watermark at the wrong time in the script. That is causing the issue you reported.

Share this post


Link to post
Share on other sites

I have tried but it is the same result as before. Watermark is 'jumping' around depending on source image size...

 

Cheers.

 

I see the problem now. I added one more instruction to the bottom:

 

find:
var $config_disable_imagecopyresampled = false;
add after:
var $skip_watermark = false;

find:
if (!empty($maxheight)) { $this->max_height = $maxheight; }
add after:
$this->skip_watermark = (ADDIMAGES_ADD_WATERMARK == 'false' ? true : $skip_watermark);

find:
if (!$skip_watermark) { $this->addWatermark(ADDIMAGES_WATERMARK_TRANSPARENCY); }
remove the line.

find:
$this->ApplyBackground();
add after:
if (!$this->skip_watermark) { $this->addWatermark(ADDIMAGES_WATERMARK_TRANSPARENCY); }

find (near line 450):
$this->outImageResourceID = $t_outImageResourceID;
add after:
$this->out_width = $this->max_width;
$this->out_height = $this->max_height;

 

Share this post


Link to post
Share on other sites

I see the problem now. I added one more instruction to the bottom:

 

find:
var $config_disable_imagecopyresampled = false;
add after:
var $skip_watermark = false;

find:
if (!empty($maxheight)) { $this->max_height = $maxheight; }
add after:
$this->skip_watermark = (ADDIMAGES_ADD_WATERMARK == 'false' ? true : $skip_watermark);

find:
if (!$skip_watermark) { $this->addWatermark(ADDIMAGES_WATERMARK_TRANSPARENCY); }
remove the line.

find:
$this->ApplyBackground();
add after:
if (!$this->skip_watermark) { $this->addWatermark(ADDIMAGES_WATERMARK_TRANSPARENCY); }

find (near line 450):
$this->outImageResourceID = $t_outImageResourceID;
add after:
$this->out_width = $this->max_width;
$this->out_height = $this->max_height;

 

Jackpot! That solved the problem. Now the watermark appears in professional state, regardless the size of source images.

 

Cheers!

Share this post


Link to post
Share on other sites

Hello,

 

I'm not sure if this can be directed from AI part. In short terms: Is it possible to get a nice CSS style frame around all images? Actually, it shall be done by CSS but maybe through AI part? :blink:

 

Cheers.

Edited by WorkingHard

Share this post


Link to post
Share on other sites

Hello,

 

I'm not sure if this can be directed from AI part. In short terms: Is it possible to get a nice CSS style frame around all images? Actually, it shall be done by CSS but maybe through AI part? :blink:

 

Cheers.

 

in the /includes/classes/displayimages.php file you can add any CSS class needed to the follow table

 

 	// start building output
	if (tep_not_null($product['products_image'])) { $this->groupout .= '<table border="0" cellspacing="0" cellpadding="4" align="'.$this->tablealignment.'" style="position: relative;">'."\n"; }

Share this post


Link to post
Share on other sites

in the /includes/classes/displayimages.php file you can add any CSS class needed to the follow table

 

 	// start building output
	if (tep_not_null($product['products_image'])) { $this->groupout .= '<table border="0" cellspacing="0" cellpadding="4" align="'.$this->tablealignment.'" style="position: relative;">'."\n"; }

Thank you for this tip!

 

However, it is not responding if I enter style specific values as "border-style:solid;" or similar. I don't want border style, just a tiny line around the images. It looks more professional.

 

Any idea how to solve this?

 

Cheers.

Share this post


Link to post
Share on other sites

Thank you for this tip!

 

However, it is not responding if I enter style specific values as "border-style:solid;" or similar. I don't want border style, just a tiny line around the images. It looks more professional.

 

Any idea how to solve this?

 

Cheers.

 

just below that in the code you should see a <td> tag being added. If you just want a line around each image only, the TD is where you want it. BTW: you might try a full border style: style="border:#FFFFFF 1px solid;" just in case there is something inherited that is making yours simply not visible. Also may need to go with a cellspacing on the table tag instead of the cellpadding.

Edited by surfalot

Share this post


Link to post
Share on other sites

Hello again surfalot & community,

 

Security question or suggestion?

 

How much I could see, it should not be a problem for any spider or 'harvest' script to gently download all image files because it is known fact that AI is sourcing images from XXX folder.

 

Now, this shouldn't be a issue really as all images are watermarked now, right?

 

BUT!

 

The SOURCE images is still there, in same folder. So my question is: Is it possible to make some setting so that source images is 'more' protected? For example, placing it at another folder or in some other way add some 'hot link' protection?

 

Maybe I'm on wrong track? :blink:

 

Cheers!

Share this post


Link to post
Share on other sites

Hello,

 

Regarding watermark size on thumbnail images. I don't know if it is just me, but shouldn't watermark size be proportional for thumbnails too?

 

I have a watermark size of 200px, applying it to thumbnails give strange results.

 

?

 

Cheers!

Share this post


Link to post
Share on other sites

Hello in the installation it says:

 

<?php // BOF: Additional Images: added: onSubmit="return check_form(new_product);" ?>

<?php echo tep_draw_form('new_product', FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '') . '&action=new_product_preview', 'post', 'enctype="multipart/form-data" onSubmit="return check_form(this);"') . tep_hide_session_id(); ?>

<?php // EOF: Additional Images ?>

 

For me it's the line 765

 

But with:

 

onSubmit="return check_form(new_product);"

 

Or:

 

onSubmit="return check_form(this);"

 

I still have the same error when I add a new product:

 

Fatal error: Call to undefined function tep_hide_session_id() in /public_html/portail/****/***/admin/categories.php on line 765

 

When i want édit a product :

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' p.products_image_med, p.products_image_pop, p.products_image_description, p.pro' at line 1

 

select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_pdfupload, p.products_price, p.products_weight, p.products_date_added,, p.products_image_med, p.products_image_pop, p.products_image_description, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.products_sold, p.manufacturers_id from products p, products_description pd where p.products_id = '826' and p.products_id = pd.products_id and pd.language_id = '1'

 

[TEP STOP]

 

 

I have be insert the .sql file in my data base

 

I have a problem with admin/includes/functions/html_output: in the contrib :

// The HTML image wrapper function

function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') {

$image = '<img src="' . tep_output_string($src) . '" border="0" alt="' . tep_output_string($alt) . '"';

 

if (tep_not_null($alt)) {

$image .= ' title=" ' . tep_output_string($alt) . ' "';

}

 

// BOF: Additional Images

/* if (tep_not_null($width) && tep_not_null($height)) {

$image .= ' width="' . tep_output_string($width) . '" height="' . tep_output_string($height) . '"';

} */

if (tep_not_null($width)) {

$image .= ' width="' . tep_output_string($width) . '"';

}

if (tep_not_null($height)) {

$image .= ' height="' . tep_output_string($height) . '"';

}

// EOF: Additional Images

 

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

 

$image .= '>';

 

return $image;

}

 

////

// The HTML form submit button wrapper function

// Outputs a button in the selected language

 

In my page:

// The HTML image wrapper function
 function tep_image($src, $alt = '', $width = '', $height = '', $params = '') {
   $image = '<img src="' . $src . '" border="0" alt="' . $alt . '"';
   if ($alt) {
     $image .= ' title=" ' . $alt . ' "';
   }
   // BOF: Additional Images
/*    if (tep_not_null($width) && tep_not_null($height)) {
     $image .= ' width="' . tep_output_string($width) . '" height="' . tep_output_string($height) . '"';
   } */
   if (tep_not_null($width)) {
     $image .= ' width="' . tep_output_string($width) . '"';
   }
   if (tep_not_null($height)) {
     $image .= ' height="' . tep_output_string($height) . '"';
   }
// EOF: Additional Images
   if ($params) {
     $image .= ' ' . $params;
   }
   $image .= '>';

   return $image;
 }

////
// The HTML form submit button wrapper function
// Outputs a button in the selected language

 

It's ok ?

 

Thanks

Share this post


Link to post
Share on other sites

Hi,

Installed V.2.2.0 OK and now getting to grips with image control in the Categories/Products and New Products - finding the later a bit unstable: all images seem to need to be specified together; if I enter one, then come back to edit another, the first one tends to disappear or is ignored. Strange.

 

Main point of this request-for-help post:

With image pop-up after 'Click to Enlarge' is selected, the window initially opens towards the top left - as specified in the javascript coding about line 88 of Products_Info - before jumping to near the centre of the screen.

 

Question 1: Where can I specify the final position of the pop-up window (I can't see anywhere in the new javascript code in the Non Lightbox lines). I assume that disabling the position specification in the first bit of java code will stop the initial pop-up.

Question 2: Is it possible to specify the opening size of the pop-up window (presumably at the same place as Q1!).

 

Thanks,

 

Mike

Share this post


Link to post
Share on other sites

Hello again surfalot & community,

 

Security question or suggestion?

 

How much I could see, it should not be a problem for any spider or 'harvest' script to gently download all image files because it is known fact that AI is sourcing images from XXX folder.

 

Now, this shouldn't be a issue really as all images are watermarked now, right?

 

BUT!

 

The SOURCE images is still there, in same folder. So my question is: Is it possible to make some setting so that source images is 'more' protected? For example, placing it at another folder or in some other way add some 'hot link' protection?

 

Maybe I'm on wrong track? :blink:

 

Cheers!

good point but someone would have to go to great lengths to write a script that will exploit this only for a relatively small number of sites. you can add hotlink protection to the root images folder with a .htaccess if you wish.

Share this post


Link to post
Share on other sites

Hello,

 

Regarding watermark size on thumbnail images. I don't know if it is just me, but shouldn't watermark size be proportional for thumbnails too?

 

I have a watermark size of 200px, applying it to thumbnails give strange results.

 

?

 

Cheers!

 

it's just you :)

 

I never considered a giant watermark, and didn't think many would even watermark their thumbs at all since it would make it hard to see the product. Stock photo sites don't even watermark their thumbs.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×