Ignore:
Timestamp:
Dec 4, 2009, 10:30:31 AM (14 years ago)
Author:
ronosman
Message:

Feature 1055 added : preparation of high definition images ( HD ).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/pLoader/trunk/src/Uploader/ImageList.pm

    r4409 r4422  
    4343                blur
    4444                quality
     45                resize_w
     46                resize_h
     47                hd_filter
     48                hd_blur
     49                hd_quality
     50                hd_w
     51                hd_h
     52                                hd_interlace
    4553                prefix
    4654                author
    4755                count
    48                 resize_w
    49                 resize_h
    5056                new_files
    5157                storable_file
     
    8086                pwg
    8187                upload_high
     88                                upload_hd
    8289                remove_uploaded_from_selection
    8390                wx_quality
     
    721728                resize_w
    722729                resize_h
     730                hd_filter
     731                hd_blur
     732                hd_quality
     733                hd_w
     734                hd_h
     735                                hd_interlace
    723736                new_files
    724737                storable_file
     
    734747                default_name_prefix
    735748                upload_high
     749                                upload_hd
    736750                remove_uploaded_from_selection
    737751                auto_rotate
     
    829843    }
    830844
     845        my $decode = {
     846        'No' => 0,
     847            'Yes, use HD resized of the original photo' => 'HD',
     848            'Yes, use a copy of the original photo' => 'ORIGINAL',
     849    }; 
     850
     851        $self->upload_high(
     852            $decode->{$self->upload_hd}
     853        );
     854       
    831855    # if upload high, rotate a copy of original file
    832856    if($self->upload_high){
     
    10511075    my ( $self ) = @_;
    10521076
     1077printf("CreateHigh %s\n", $self->upload_high);
    10531078    my $bModifyOriginal;
    10541079    my $bRotate;
    10551080    my $bAddWatermark;
     1081        my $bResize;
    10561082    my $orientation = $self->current_image->exif_metadata->{Orientation};
     1083        my $degrees;
    10571084   
    10581085    # Valid for Rotate 180, Rotate 90 CW, Rotate 270 CW
     
    10601087        $bModifyOriginal = 1;
    10611088        $bRotate = 1;
     1089                $degrees = $1;
    10621090    }
    10631091
     
    10661094        $bAddWatermark = 1;
    10671095    }
     1096       
     1097        # HD resize
     1098        if('HD' eq $self->upload_high){
     1099        $bModifyOriginal = 1;
     1100        $bResize = 1;
     1101        }
    10681102
    10691103    if($bModifyOriginal){
     
    10771111        warn "$status ", $self->current_image->file, "\n" if $status ;
    10781112        return 0 if $status;
    1079 
     1113        if($bResize){
     1114            $status = $image->Resize(
     1115                geometry => sprintf("%sx%s>", $self->hd_w, $self->hd_h),
     1116                filter => sprintf("%s", $self->hd_filter),
     1117                blur => $self->hd_blur
     1118            );
     1119            warn "$status" if $status ;
     1120            return 0 if $status;
     1121        }
     1122       
     1123        printf("resize with quality value %s\n", $self->quality);
     1124        $status = $image->Set(quality=>$self->quality);
     1125        warn "$status" if $status ;
     1126
     1127        $status = $image->Set(interlace=>$self->interlace);
     1128        warn "$status" if $status ;
     1129               
    10801130        if($bRotate){
    1081             $image->Rotate( degrees=>$1 );     
     1131            $image->Rotate( degrees=>$degrees );       
    10821132        }       
    10831133        $image->Write(
     
    11341184        my ( $filename, $ext ) = split /\./, $file ;
    11351185   
    1136         # high_file is a copy of original
     1186        # high_file is a resized of original
    11371187        $self->current_image->site_high_file(
    11381188            File::Spec->catfile(
Note: See TracChangeset for help on using the changeset viewer.