JPG/PNG Image Optimization

keep-calm-and-start-optimizing[1]In a previous post I refer to image optimization. I started working with image optimization when i got reports from the google webmaster tools that the images used in my web sites are not optimized.

Searching in the internet I ended up working with jpegtran and optipng for the optimization of the images I use in the web. I use the following two batches to automate somehow the whole process. I place the image inside the “Optimize” folder and then according to the file type run the appropriate batch script.

cd "E:\Dropbox\wamp\www\Optimise"
E:
FOR %%G IN (*.jpg) DO (
copy %%G log\%%G
"E:\Dropbox\wamp\www\Optimise\JPGPNGOPT\jpegtran\jpegtran.exe" -optimize %%G %%G
MOVE %%G OPTED\%%G
)
 FOR %%G IN (*.png) DO (
copy %%G log\%%G
"E:\Dropbox\wamp\www\Optimise\JPGPNGOPT\pngout.exe" "E:\Dropbox\wamp\www\Optimise\%%G" "E:\Dropbox\wamp\www\Optimise\%%G" /y
MOVE %%G OPTED\%%G
)

 

Ebay Partner Network

Ebay Partner NetworkThe Ebay partner network is another way to monetize your web site (from adsense). Initially you need to apply to their web site, and after around a week you will get an email welcoming /or not you to their network.

Ebay easy ways to generate links or banners to their products (links, banner generator, api, widget):

Link generator

The link generator allows you to create a trackable link to any of eBay Partner Network’s program pages and is great for all types of business models. Best of all, by using this tool to direct visitors to relevant pages you can significantly increase conversion rates

Creatives generator

Choose from a variety of colorful graphic and interactive ads to enhance your site and attract visitors to eBay Partner Network pages from your webpage.

Widgets

Including RSS Feeds, and Custom Banners; we offer innovative and customizable widgets to drive traffic and increase user conversions.

API

Leverage eBay’s advanced web services platform to develop innovative applications to tap into eBay’s marketplace. Our API provides tools and services that meet the diverse needs of over 200 million online shoppers. You can use virtually any programming language to interface with eBay Web Services!

Ebay Partner Network Hits Chart/

 

I ll post some updates as soon as i get the first payment.. if..

PHP Image Resizing…

I have been searching for some time an easy way to change the size of jpg and png images on the fly – on the server. currently my preferred solution is the PHP Image resize script found here ..

The solution is extremely easy to implement. I use it to convert almost 1000 images whos filenames have stored in the database (on the fly).

Have found the following issues though:

  1. All of my images are google optimized (using jpegtran and optipng). After the conversion the new file is 10 times larger in size even though the  dimensions are similar (197×50 and 6kb to 200×50 and 30kb size). So there goes my optimization…
  2. I have manually converted most of my files to width 200 to match my web site layout. When an already 200pixels image passes from the script that sets it to comvert again to 100px,  it sometimes produces a blank png file with, and some times the quality of the image is very bad (even though you set it to convert with the highest quality). I will need to investigate this why the script behaves differently to different png  files if i wanna keep it.
$file="./brands/".$row_Recordset1['NAME']."/logo.png";
$resizedFile="./brands/".$row_Recordset1['NAME']."/".strtolower(str_replace ( ' ', '-', $row_Recordset1['NAME']))."_reslogo.png";

list($width, $height) =getimagesize($file);

echo $width;

//echo $height;

if (file_exists($file)){

 

if (file_exists($resizedFile)){

//to nothing

}else {

smart_resize_image($file , null, 201 , null , true , $resizedFile , false , false ,100 );
}
}else{
$resizedFile="./brands/no-logo-yet.png";
}

Update: Found that issue #2 was caused by the fact that i was scaling the image up, rather than down.  Issue #1 still persists though.

Here is a very informative post about the jpg image optimization and resizing using php native functions

 

Hello world!

Hello Wolrd! I am here!
Hello Wolrd! I am here!

Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!

You can also leave it as it is and continue writing below it.

This is the 17th time i set up a wordpress site for tharsitis.gr. This time i am committed to it. I will try to have regular updates of my IT-life.