Index: trunk/extensions/PagedTiffHandler/tests/PagedTiffHandlerTest.php |
— | — | @@ -97,7 +97,7 @@ |
98 | 98 | $this->handler->normaliseParams($this->image, $params ); |
99 | 99 | $this->assertEquals($params['height'], 75); |
100 | 100 | // makeParamString |
101 | | - $this->assertEquals($this->handler->makeParamString(array('width'=>'100', 'page'=>'4')), "lossless-page4-100px"); |
| 101 | + $this->assertEquals($this->handler->makeParamString(array('width'=>'100', 'page'=>'4', 'lossy'=>'lossless')), "lossless-page4-100px"); |
102 | 102 | |
103 | 103 | // ---- File upload checks and Thumbnail transformation |
104 | 104 | // check |
Index: trunk/extensions/PagedTiffHandler/PagedTiffHandler_body.php |
— | — | @@ -156,7 +156,13 @@ |
157 | 157 | if ( !isset( $params['width'] ) ) { |
158 | 158 | return false; |
159 | 159 | } |
160 | | - $lossy = isset( $params['lossy'] ) && $params['lossy'] ? 'lossy' : 'lossless'; |
| 160 | + |
| 161 | + if ( !isset( $params['lossy'] ) || in_array( $params['lossy'], array( 1, '1', 'true', 'lossy' ) ) ) { |
| 162 | + $lossy = 'lossy'; |
| 163 | + } else { |
| 164 | + $lossy = 'lossless'; |
| 165 | + } |
| 166 | + |
161 | 167 | return "{$lossy}-page{$page}-{$params['width']}px"; |
162 | 168 | } |
163 | 169 | |