Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


For debug testing you can write the dimensions of the new image into the... #38

wants to merge 1 commit into from

2 participants


... generated image.


not working, doesnt add dimensions

When the image exsist in cache, it dosn´t override. Have you tryed to delete the cached images?

Yes. The img is created in cache, but without the text and the img doesnt load in the page. If i load the img directly, i get 'img cannot be displayed cuz it contains errors'. I tried sticking some @s in there, to no avail. Maybe its cuz i'm testing on local Win. I'll try sometime on the real server. Once the img has been cached(sans dimension txt) I get the img in the page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 22, 2012
  1. @7samurai
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 0 deletions.
  1. +7 −0 adaptive-images.php
7 adaptive-images.php
@@ -18,6 +18,7 @@
$sharpen = TRUE; // Shrinking images can blur details, perform a sharpen on re-scaled images?
$watch_cache = TRUE; // check that the responsive image isn't stale (ensures updated source images are re-cached)
$browser_cache = 60*60*24*7; // How long the BROWSER cache should last (seconds, minutes, hours, days. 7days by default)
+$debug_mode = TRUE; // Write new Image dimentions into the stored image
/* END CONFIG ----------------------------------------------------------------------------------------------------------
------------------------ Don't edit anything after this line unless you know what you're doing -------------------------
@@ -148,6 +149,12 @@ function generateImage($source_file, $cache_file, $resolution) {
imagefilledrectangle($dst, 0, 0, $new_width, $new_height, $transparent);
ImageCopyResampled($dst, $src, 0, 0, 0, 0, $new_width, $new_height, $width, $height); // do the resize in memory
+ if($debug_mode){
+ // write a textstring with the dimensions
+ $color = imagecolorallocate($dst, 249, 4, 4); // ugly red
+ imagestring( $dst, 5, 5, 5, $new_width." / ".$new_height,$color);
+ }
// sharpen the image?
Something went wrong with that request. Please try again.