Skip to content

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

Notifications You must be signed in to change notification settings

jakerb/ImageTable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 

Repository files navigation

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!

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages