Advanced search  


cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.

Pages: [1]   Go Down

Author Topic: sharpen images cpmfetch  (Read 4059 times)

0 Members and 1 Guest are viewing this topic.


  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 143
sharpen images cpmfetch
« on: April 30, 2010, 10:33:06 pm »


I fetch some large images and resize them to 500 pixel.
After resizing they often get displayed a little blurred in the browser window.

My solution to sharpen them a little bit:

1. get pixastic.custom.js from here
You can create the custom.js in the download section. Just mark "pixastic core, unsharpmask, minify"

2. in your self coded .php file
a) create a class for the image file where you define the parameters of the img tag; here it is named "ihomepage"
b) include after </style> the pixastic.custom.js

In my code I fetch the last added picture in category 4, for example.

Code: [Select]
<style type="text/css">
img.ihomepage {width:500px; border:0px;}
<script type="text/javascript">var pixastic_parseonload = true;</script>
<script src="" type="text/javascript"></script>
include_once "cpmfetch.php"
$objCpm = new cpm("cpmfetch_config.php");
$options = array(
"imagestyle" => "ihomepage",


3. search this line in cpmfetch.php and add pixastic pixastic-unsharpmask(amount=40;radius=0.3;threshold=8)

 if (array_key_exists('imagestyle',$options)) $this->styleHash['imagestyle'] = 'class="' . $options['imagestyle'] . ' pixastic pixastic-unsharpmask(amount=40;radius=0.3;threshold=8)" ';

Set the parameters how you like.

Best regards, dwo

Pages: [1]   Go Up

Page created in 0.023 seconds with 19 queries.