Changeset 12696 for extensions/GThumb/js/gthumb.js
- Timestamp:
- Dec 5, 2011, 7:13:13 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/GThumb/js/gthumb.js
r12691 r12696 13 13 queue: true, 14 14 cacheResponse: false, 15 maxRequests: 2,15 maxRequests: 3, 16 16 preventDoubleRequests: false 17 17 }), … … 24 24 width = parseInt(jQuery(this).attr('width')); 25 25 height = parseInt(jQuery(this).attr('height')); 26 GThumb.t.push({id:id,width:width,height:height}); 26 th = {id:id,width:width,height:height,real_width:width,real_height:height}; 27 if (height < GThumb.max_height) { 28 th.width = Math.round(GThumb.max_height * width / height); 29 th.height = GThumb.max_height; 30 } 31 GThumb.t.push(th); 27 32 28 33 if (jQuery(this).attr('src') == '') { … … 164 169 new_width = Math.round(new_width); 165 170 } 166 this.resize(jQuery('#gt'+thumb_process[j].id), thumb_process[j]. width, thumb_process[j].height, new_width, new_height, false);171 this.resize(jQuery('#gt'+thumb_process[j].id), thumb_process[j].real_width, thumb_process[j].real_height, new_width, new_height, false); 167 172 168 173 width_count += new_width + this.margin; … … 177 182 // Last line does not need to be cropped 178 183 for (j=0;j<thumb_process.length;j++) { 179 this.resize(jQuery('#gt'+thumb_process[j].id), thumb_process[j]. width, thumb_process[j].height, thumb_process[j].width, max_height, false);184 this.resize(jQuery('#gt'+thumb_process[j].id), thumb_process[j].real_width, thumb_process[j].real_height, thumb_process[j].width, max_height, false); 180 185 } 181 186 … … 187 192 resize: function(thumb, width, height, new_width, new_height, is_big) { 188 193 189 if (this.method == 'resize' ) {190 real_width = Math.min(new_width, width);191 real_height = Math.min(new_height, height);194 if (this.method == 'resize' || height < new_height || width < new_width) { 195 real_width = new_width; 196 real_height = new_height; 192 197 width_crop = 0; 193 198 height_crop = 0;
Note: See TracChangeset
for help on using the changeset viewer.