sharpen images cpmfetch sharpen images cpmfetch
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

sharpen images cpmfetch

Started by dwo, April 30, 2010, 10:33:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dwo

Hello.

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 http://www.pixastic.com/
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.


<html><head>
<style type="text/css">
img.ihomepage {width:500px; border:0px;}
</style>
<script type="text/javascript">var pixastic_parseonload = true;</script>
<script src="http://www.xyz.com/pixastic.custom.js" type="text/javascript"></script>
</head>
<?php
 
include_once "cpmfetch.php"
 
$objCpm = new cpm("cpmfetch_config.php");
 
$options = array(
 
"imagestyle" => "ihomepage",
 );
 
$objCpm->cpm_viewLastAddedMediaFrom("cat=4"11$options);
 
$objCpm->cpm_close();?>

</html>



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