Timber - Version 0.12.1

Version Description

  • A few fixes that catch issues with absolute vs. relative URLs in resize
Download this release

Release Info

Developer jarednova
Plugin Icon 128x128 Timber
Version 0.12.1
Comparing to
See all releases

Code changes from version 0.12.0 to 0.12.1

functions/functions-wp-image-helper.php CHANGED
@@ -8,6 +8,7 @@
8
  }
9
 
10
  function img_to_jpg($src, $bghex = '#FFFFFF'){
 
11
  $output = str_replace('.png', '.jpg', $src);
12
  $input_file = $_SERVER['DOCUMENT_ROOT'] . $src;
13
  $output_file = $_SERVER['DOCUMENT_ROOT'] . $output;
@@ -80,7 +81,7 @@
80
  $new_path = $dir . '/' . $newbase . '.' . $ext;
81
  $new_path = str_replace(site_url(), '', $new_path);
82
  $new_root_path = $_SERVER['DOCUMENT_ROOT'] . $new_path;
83
- $old_root_path = $_SERVER['DOCUMENT_ROOT'] . $src;
84
 
85
  $old_root_path = str_replace('//', '/', $old_root_path);
86
  $new_root_path = str_replace('//', '/', $new_root_path);
8
  }
9
 
10
  function img_to_jpg($src, $bghex = '#FFFFFF'){
11
+ $src = str_replace(site_url(), '', $src);
12
  $output = str_replace('.png', '.jpg', $src);
13
  $input_file = $_SERVER['DOCUMENT_ROOT'] . $src;
14
  $output_file = $_SERVER['DOCUMENT_ROOT'] . $output;
81
  $new_path = $dir . '/' . $newbase . '.' . $ext;
82
  $new_path = str_replace(site_url(), '', $new_path);
83
  $new_root_path = $_SERVER['DOCUMENT_ROOT'] . $new_path;
84
+ $old_root_path = $_SERVER['DOCUMENT_ROOT'] . str_replace(site_url(), '', $src);
85
 
86
  $old_root_path = str_replace('//', '/', $old_root_path);
87
  $new_root_path = str_replace('//', '/', $new_root_path);
functions/timber-image.php CHANGED
@@ -17,6 +17,10 @@ class TimberImage extends TimberCore {
17
  return '';
18
  }
19
 
 
 
 
 
20
  function get_src() {
21
  if (isset($this->abs_url)) {
22
  return $this->abs_url;
17
  return '';
18
  }
19
 
20
+ function get_pathinfo(){
21
+ return pathinfo($this->file);
22
+ }
23
+
24
  function get_src() {
25
  if (isset($this->abs_url)) {
26
  return $this->abs_url;
readme.txt CHANGED
@@ -37,6 +37,9 @@ Timber is great for any WordPress developer who cares about writing good, mainta
37
 
38
  == Changelog ==
39
 
 
 
 
40
  = 0.12.0 =
41
  * Pagination is refactored to be more intutitve, and well, better.
42
  * Resize is also refactored to respect absolute vs. relative URLs
37
 
38
  == Changelog ==
39
 
40
+ = 0.12.1 =
41
+ * A few fixes that catch issues with absolute vs. relative URLs in resize
42
+
43
  = 0.12.0 =
44
  * Pagination is refactored to be more intutitve, and well, better.
45
  * Resize is also refactored to respect absolute vs. relative URLs
timber.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Timber
4
  Description: The WordPress Timber Library allows you to write themes using the power Twig templates
5
  Author: Jared Novack + Upstatement
6
- Version: 0.12.0
7
  Author URI: http://timber.upstatement.com/
8
  */
9
 
3
  Plugin Name: Timber
4
  Description: The WordPress Timber Library allows you to write themes using the power Twig templates
5
  Author: Jared Novack + Upstatement
6
+ Version: 0.12.1
7
  Author URI: http://timber.upstatement.com/
8
  */
9