Changeset 4422


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

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

Location:
extensions/pLoader/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • extensions/pLoader/trunk/locale/fr_FR/pLoader.po

    r4279 r4422  
    2727
    2828msgid "Site thumbnail size :"
    29 msgstr "Taille des miniature :"
     29msgstr "Taille des miniatures :"
    3030
    3131msgid "Site image width :"
     
    508508msgid "errors"
    509509msgstr "erreurs"
     510
     511msgid "Yes, use HD resized of the original photo"
     512msgstr "Oui, utiliser une réduction HD de la photo originale"
     513
     514msgid "Yes, use a copy of the original photo"
     515msgstr "Oui, utiliser une copie de la photo originale"
     516
     517msgid "HD image width :"
     518msgstr "Largeur de l'image HD :"
     519
     520msgid "HD image height :"
     521msgstr "Hauteur de l'image HD :"
     522
     523msgid "HD image jpeg quality :"
     524msgstr "Qualité jpeg de l'image HD :"
     525
     526msgid "HD image filter :"
     527msgstr "Filtre de réduction de l'image HD :"
     528
     529msgid "HD image blur :"
     530msgstr "Accentuation/flou de l'image HD :"
     531
     532msgid "HD image interlace :"
     533msgstr "Entrelacement de l'image HD :"
  • extensions/pLoader/trunk/src/Uploader/GUI/wxApp.pm

    r4408 r4422  
    109109          default_photo_names
    110110          eng_default_photo_names
     111                  upload_hd
     112                  eng_upload_hd
    111113      /
    112114);
     
    130132    # to check if we can use stored cache
    131133    $self->imagelist_version(
    132         '8'
     134        '9'
    133135    );
    134136
     
    269271        }
    270272    );
    271 
     273       
     274        $self->upload_hd(
     275            [
     276                    'No',
     277                        'Yes, use HD resized of the original photo',
     278                        'Yes, use a copy of the original photo',
     279                ]
     280        );
     281
     282    $self->eng_upload_hd(
     283        {
     284             map { gettext($_) => $_ } @{$self->upload_hd}
     285        }
     286    );
     287       
    272288    $self->default_photo_names(
    273289        [
     
    460476    my $params = {
    461477        new_files        => [],
     478        hd_filter        => 'Lanczos',
     479        hd_blur          => 0.9,
     480        hd_quality       => 95,
     481        hd_w             => 1600,
     482        hd_h             => 1200,
     483        hd_interlace     => 'Line',
    462484        thumb_size       => 120,
    463485        site_thumb_dir   => $self->thumb_dir,
     
    474496        th_quality       => 90,
    475497        auto_rotate      => 1,
     498                upload_hd        => 'No',
    476499        remove_uploaded_from_selection => 1,
    477500        interlace        => 'Line',
  • extensions/pLoader/trunk/src/Uploader/GUI/wxFrameAUI.pm

    r4408 r4422  
    106106          resized_settings_panel
    107107          thumbnail_settings_panel
     108                  hd_settings_panel
    108109          advanced_settings_panel
    109110          watermark_settings_panel
     
    113114          resized_settings
    114115          thumbnail_settings
     116                  hd_settings
    115117          advanced_settings
    116118          watermark_settings
     
    391393            },
    392394            {
    393                 label     => gettext("Upload high (original size) :"),
    394                 type      => 'Bool',
    395                 value   => sub { $self->imagelist->upload_high(@_) },
     395                label     => gettext("Upload high definition  :"),
     396                type      => 'Choice',
     397                choice  => [
     398                               map { gettext $_ } @{wxTheApp->upload_hd}
     399                           ],
     400                pre_process => sub { my ( $value ) = @_; wxTheApp->eng_upload_hd->{$value} },
     401                value   => sub { $self->imagelist->upload_hd(@_) },
    396402            },
    397403            {
     
    440446    );
    441447
     448    $self->hd_settings(
     449        [
     450            {
     451                label     => gettext("HD image width :"),
     452                type      => 'Number',
     453                value   => sub { $self->imagelist->hd_w(@_) },
     454            },
     455            {
     456                label     => gettext("HD image height :"),
     457                type      => 'Number',
     458                value   => sub { $self->imagelist->hd_h(@_) },
     459            },
     460            {
     461                label     => gettext("HD image jpeg quality :"),
     462                type      => 'Number',
     463                value   => sub { $self->imagelist->hd_quality(@_) },
     464            },
     465            {
     466                label     => gettext("HD image filter :"),
     467                type      => 'Choice',
     468                value   => sub { $self->imagelist->hd_filter(@_) },
     469                choice    => [ qw/Point Box Triangle Hermite Hanning Hamming Blackman Gaussian Quadratic Cubic Catrom Mitchell Lanczos Bessel Sinc/ ],
     470            },
     471            {
     472                label     => gettext("HD image blur :"),
     473                type      => 'Float',
     474                value   => sub { $self->imagelist->hd_blur(@_) },
     475            },
     476            {
     477                label     => gettext("HD image interlace :"),
     478                type      => 'Choice',
     479                value   => sub { $self->imagelist->hd_interlace(@_) },
     480                choice    => [ qw/None Line Plane Partition JPEG GIF PNG/ ],
     481            },
     482        ]   
     483    );
     484       
    442485    $self->thumbnail_settings(
    443486        [
     
    465508    );
    466509   
    467 #    $self->preview_settings(
    468 #        [
    469 #            {
    470 #                label     => gettext("Use exif preview when available :"),
    471 #                type      => 'Bool',
    472 #                value  => sub { $self->imagelist->use_exif_preview(@_) },
    473 #            },
    474 #            {
    475 #                label     => gettext("Custom preview ratio :"),
    476 #                type      => 'Number',
    477 #                value  => sub { $self->imagelist->preview_ratio(@_) },
    478 #            },
    479 #        ]   
    480 #    );
    481510
    482511    $self->advanced_settings(
     
    584613        $self->resized_settings_panel,
    585614        $self->thumbnail_settings_panel,
     615        $self->hd_settings_panel,
    586616        $self->advanced_settings_panel,
    587617        $self->watermark_settings_panel,
     
    655685    );   
    656686
    657     #$self->preview_settings_panel->properties(
    658     #    $self->preview_settings,
    659     #);   
     687    $self->hd_settings_panel->properties(
     688        $self->hd_settings,
     689    );   
    660690
    661691    $self->advanced_settings_panel->properties(
     
    715745                parentwnd       => $self,
    716746                properties      => $self->thumbnail_settings,
    717 
    718747            }
    719748        )   
    720749    );   
    721     #$self->preview_settings_panel(
    722     #    Uploader::GUI::wxPropertyGridPanel->new(
    723     #        {
    724     #            parentwnd       => $self,
    725     #            properties      => $self->preview_settings,
    726 
    727     #        }
    728     #    )   
    729     #);   
     750    $self->hd_settings_panel(
     751        Uploader::GUI::wxPropertyGridPanel->new(
     752            {
     753                parentwnd       => $self,
     754                properties      => $self->hd_settings,
     755            }
     756        )   
     757    );   
    730758
    731759    $self->watermark_settings_panel(
     
    743771                parentwnd       => $self,
    744772                properties      => $self->advanced_settings,
    745 
    746773            }
    747774        )   
     
    10501077            gettext("Thumbnail"),
    10511078        ],
    1052 #        [
    1053 #            $self->preview_settings_panel,
    1054 #            gettext("Preview"),
    1055 #        ],
     1079        [
     1080            $self->hd_settings_panel,
     1081            gettext("HD"),
     1082        ],
    10561083        [
    10571084            $self->watermark_settings_panel,
  • 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(
  • extensions/pLoader/trunk/src/Uploader/PWG/WebServices.pm

    r4291 r4422  
    307307                $status_line = $high_params->{message};
    308308                last if !$high_params->{ok};
     309                                # high is a HD resized copy of original
     310                                $form->{high_sum} = $self->sum_high_file;
    309311            }
    310312            $doubleCheck = 1;
Note: See TracChangeset for help on using the changeset viewer.