Changeset 3082 for trunk/lib/MT/Asset/Image.pm
- Timestamp:
- 10/03/08 01:07:01 (14 months ago)
- Files:
-
- 1 modified
-
trunk/lib/MT/Asset/Image.pm (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/MT/Asset/Image.pm
r2635 r3082 231 231 232 232 require MT::Util; 233 my $format = $param{Format} || MT->translate('%f-thumb-%wx%h %x');233 my $format = $param{Format} || MT->translate('%f-thumb-%wx%h-%i%x'); 234 234 my $width = $param{Width} || 'auto'; 235 235 my $height = $param{Height} || 'auto'; … … 550 550 $app->translate( "Invalid basename '[_1]'", $rel_path ) ); 551 551 } 552 $rel_path .= '-' . $asset->id; 552 553 my $ext = $blog->file_extension || ''; 553 554 $ext = '.' . $ext if $ext ne ''; … … 567 568 File::Spec->catfile( $root_path, $rel_path . $ext ); 568 569 569 ## If the popup filename already exists, we don't want to overwrite570 ## it, because it could contain valuable data; so we'll just make571 ## sure to generate the name uniquely.572 570 my ( $i, $rel_path_ext ) = ( 0, $rel_path . $ext ); 573 while ( $fmgr->exists($abs_file_path) ) {574 $rel_path_ext = $rel_path . ++$i . $ext;575 $abs_file_path =576 File::Spec->catfile( $root_path, $rel_path_ext );577 }578 571 $pseudo_path = File::Spec->catfile( $pseudo_path, $rel_path_ext ); 579 572 my ( $vol, $dirs, $basename ) = … … 600 593 $original = $asset_html->clone; 601 594 $asset_html->blog_id($blog_id); 602 $asset_html->url($pseudo_path); 595 my $pseudo_url = $pseudo_path; 596 $pseudo_url =~ s!\\!/!g; 597 $asset_html->url($pseudo_url); 603 598 $asset_html->label($app->translate("Popup Page for [_1]", $asset->label || $asset->file_name)); 604 599 $asset_html->file_path($pseudo_path); … … 610 605 } else { 611 606 $original = $asset_html->clone; 612 } 607 } 613 608 614 609 # Select back the real URL for callbacks
