Using Smart Image with 1 image as default Topic is solved

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
master3395
Forum Members
Forum Members
Posts: 94
Joined: Mon Mar 30, 2015 7:13 am
Location: Norway

Using Smart Image with 1 image as default

Post by master3395 »

Hello, i do not know if this module has a way to use 1 image as default.

My config page has this in it:

Code: Select all

$config['____divider____']               = 'CMSMSExt SETTINGS';
$config['xt_prettyhtml']                 = 'true';
$config['xt_minhtml']                    = 'true';
$config['xt_allow_watermarking']         = 'true';
$config['xt_watermark_file']	           = 'NewsTargeted.jpg'; /* relative to the uploads folder */
$config['xt_watermark_translucency']     = '50'; /* Transparent % */
#$config['xt_watermark_alignment']       = '0'; /* upper left */
#$config['xt_watermark_alignment']       = '1'; /* upper center */
#$config['xt_watermark_alignment']       = '2'; /* upper right */
#$config['xt_watermark_alignment']       = '3'; /* middle left */
#$config['xt_watermark_alignment']        = '4'; /* middle center */
#$config['xt_watermark_alignment']       = '5'; /* middle right */
#$config['xt_watermark_alignment']       = '6'; /* lower left */
#$config['xt_watermark_alignment']       = '7'; /* lower center */
$config['xt_watermark_alignment']       = '8'; /* lower right */

Would this work to get the default watermark file?`

Code: Select all

{SmartImage src=$imgSrc filter_croptofit='600,337,c,1' filter_watermark=1 noembed=1 notag=1 force_ext=1}"}
Or do I have to use:

Code: Select all

{SmartImage src=$imgSrc filter_croptofit='600,337,c,1' filter_watermark='uploads/NewsTargeted.png' noembed=1 notag=1 force_ext=1}"}
One template I have, this is what it looks like:

Code: Select all

{si_convert filter_watermark=1 noembed=1 max_width=600 max_height=600}{$content}{/si_convert}
User avatar
PinkElephant
Forum Members
Forum Members
Posts: 169
Joined: Fri Feb 06, 2009 2:08 pm

Re: Using Smart Image with 1 image as default

Post by PinkElephant »

Hi master3395
master3395 wrote: Thu Apr 06, 2023 11:55 pmi do not know if this module has a way to use 1 image as default.
For watermarking, I think it can only use one file, whatever's defined in /modules/CMSMSExt/data/cfg.inc...
master3395 wrote: Thu Apr 06, 2023 11:55 pmMy config page

Code: Select all

$config['xt_watermark_file']	           = 'NewsTargeted.jpg'; /* relative to the uploads folder */
... or "any text" you supply as String.
master3395 wrote: Thu Apr 06, 2023 11:55 pmWould this work to get the default watermark file?`

Code: Select all

{SmartImage src=$imgSrc filter_croptofit='600,337,c,1' filter_watermark=1 noembed=1 notag=1 force_ext=1}"}
Yes, Boolean true, grab the file. However, I don't know which image formats are supported -- maybe it wants .png rather than non-transparent .jpg. The Admin log should show an error message if it's using something it doesn't like. Also, be aware...
master3395 wrote: Thu Apr 06, 2023 11:55 pm

Code: Select all

filter_croptofit='600,337,c,1' filter_watermark='uploads/NewsTargeted.png'
... that the watermark is applied prior to cropping; it may not be visible depending on the two image sizes, ratios & settings (moot in this case because you provided a String).
User avatar
master3395
Forum Members
Forum Members
Posts: 94
Joined: Mon Mar 30, 2015 7:13 am
Location: Norway

Re: Using Smart Image with 1 image as default

Post by master3395 »

I tried switching to .png on the image, but it does not seem to become 50% transparent anyways.
Also, it seems to take up almost 1/4 of my whole images.
Skjermbilde 2023-04-09 022734.jpg
User avatar
master3395
Forum Members
Forum Members
Posts: 94
Joined: Mon Mar 30, 2015 7:13 am
Location: Norway

Re: Using Smart Image with 1 image as default

Post by master3395 »

Seems that i had to use .png but use another image that was transparent from before.
Skjermbilde 2023-04-09 041246.jpg
User avatar
PinkElephant
Forum Members
Forum Members
Posts: 169
Joined: Fri Feb 06, 2009 2:08 pm

Re: Using Smart Image with 1 image as default

Post by PinkElephant »

I'm glad that you've got it working the way you want.

When I read your post a quick test with a .png embed seemed fine and I didn't look further. Looking again now - on a site that hasn't seen CGSmartImage/CGExtensions - I'm seeing buggy behaviour: an inability to use the String value at all and at one point, $sitename unexpectedly appeared top-left of image. (Constantly clearing the template and image caches didn't seem to help).

It's a super-useful module, almost essential, and it would be great to see template parameter support extended to the watermark 'file', 'text-size' (ideally, proportional) and positioning. JASMOP ;)

When I get time I'll provide a detailed breakdown of the behaviour I'm seeing under vanilla SmartImage.
Post Reply

Return to “Modules/Add-Ons”