Skip to content

Latest commit

 

History

History
49 lines (29 loc) · 1.44 KB

README.md

File metadata and controls

49 lines (29 loc) · 1.44 KB

ImageTable in Mac Mail

ImageTable

Convert images to HTML tables using GD, great for email templates.

Jake

Click the image above to view the demo.

This is an experimental project created to try and overcome the issue of loading images into email templates by replacing them using a table. This project works great with small icons and graphics, it's not recommended for larger images.

Requirements

  • PHP 5+
  • GD Library

Filesize

Using the thumbnail of Brad Pitt me above which is 6KB as a JPEG image is turned into a 271KB HTML file once rendered. The size difference is substantial and ImageTable has been optimized to output the smallest filesize based on tests. If you can contribute a more efficient output then please PR!

How to Use

This simple class can turn any PNG, JPG or JPEG into a valid HTML table. Heres an example of how to use ImageTable.

<?php 

require './ImageTable.php';

$image_file = 'image.png';

$it = new jakerb\ImageTable($image_file);

?>

Output HTML to browser

$it->renderTable();

Output HTML to new file

$it->renderTable('image-table.html');

That's it! Star this project if you've found it useful!