IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Langage PHP Discussion :

Qualité d'image redimensionné [PHP 5.4]


Sujet :

Langage PHP

  1. #1
    Candidat au Club
    Femme Profil pro
    Enseignant
    Inscrit en
    Mars 2015
    Messages
    2
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 48
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Enseignant
    Secteur : Conseil

    Informations forums :
    Inscription : Mars 2015
    Messages : 2
    Points : 3
    Points
    3
    Par défaut Qualité d'image redimensionné
    Bonjour à tous,

    J'ai un composant Joomla qui est une galerie images mais les images sont compressé et c'est pas très jolie, j'ai cherché comment faire pour garder une bonne qualité mais je trouve PAS, dès fois je suis un peu une bêbete

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    <?php
    /**
    **/
     
     
    defined('_VALID_MOS') or die('Direct Access to this location is not allowed.');
     
    class Config {
        var $_configFile = null;
        var $tabs = null;
       var $selectgallery = null;
       var $usertype = null;
       var $published = null;
       var $max_image_size = null;
       var $tmb_image_wd = null;
       var $tmb_image_hg = null;
       var $slaids_text = null;
       var $slaids_wait = null;
       var $slaids_duration = null;
       var $slaids_effect = null;
       var $slaids_transitions = null;
       var $slaids_direction = null;
       var $slaids_tmbcolumn = null;
       var $slaids_tmbrows = null;
       var $img_image_wd0 = null;
       var $img_image_hg0 = null;
       var $tmb_image_wd0 = null;
       var $tmb_image_hg0 = null;
       var $slaids_textPosTop = null;
       var $slaids_textPosLeft = null;
       var $slaids_textWrapPosTop = null;
       var $slaids_textWrapPosLeft = null;
       var $slaids_textWrapWidth = null;
       var $slaids_textWrapHeight = null;
       var $slaids_textWrapBorder = null;
       var $slaids_textWrapBackground = null;
       var $fe_columnAmount = null;
     
       var $smoothg_delay = null;
       var $smoothg_duration = null;
       var $smoothg_slideshow = null;
       var $smoothg_carousel = null;
       var $smoothg_infopane = null;
       var $smoothg_links = null;
       var $smoothg_slideinfo = null;
       var $smoothg_caropacity = null;
       var $smoothg_caropacitybig = null;
       var $smoothg_carheight = null;
       var $img_image_wd1 = null;
       var $img_image_hg1 = null;
       var $smoothg_tmbimgwd = null;
       var $smoothg_tmbimghg = null;
       var $smoothg_tmbimgspacing = null;
     
       function Config(){
            global $mosConfig_absolute_path;
            $this->_configFile = $mosConfig_absolute_path."/administrator/components/com_expgallery/config.expgallery.php";
        }
     
        function load()
        {
            require_once($this->_configFile);
            $this->selectgallery = $selectgallery;
          $this->usertype = $usertype;
          $this->published = $published;
          $this->max_image_size = $max_image_size;
          $this->tmb_image_wd = $tmb_image_wd;
          $this->tmb_image_hg = $tmb_image_hg;
          $this->slaids_text = $slaids_text;
          $this->slaids_wait = $slaids_wait;
          $this->slaids_duration = $slaids_duration;
          $this->slaids_effect = $slaids_effect;
          $this->slaids_transitions = $slaids_transitions;
          $this->slaids_direction = $slaids_direction;
          $this->slaids_tmbcolumn = $slaids_tmbcolumn;
          $this->slaids_tmbrows = $slaids_tmbrows;
          $this->img_image_wd0 = $img_image_wd0;
          $this->img_image_hg0 = $img_image_hg0;
          $this->tmb_image_wd0 = $tmb_image_wd0;
          $this->tmb_image_hg0 = $tmb_image_hg0;
          $this->slaids_textPosTop = $slaids_textPosTop;
          $this->slaids_textPosLeft = $slaids_textPosLeft;
          $this->slaids_textWrapPosTop = $slaids_textWrapPosTop;
          $this->slaids_textWrapPosLeft = $slaids_textWrapPosLeft;
          $this->slaids_textWrapWidth = $slaids_textWrapWidth;
          $this->slaids_textWrapHeight = $slaids_textWrapHeight;
          $this->slaids_textWrapBorder = $slaids_textWrapBorder;
          $this->slaids_textWrapBackground = $slaids_textWrapBackground;
          $this->fe_columnAmount = $fe_columnAmount;
     
          $this->smoothg_delay = $smoothg_delay;
          $this->smoothg_duration = $smoothg_duration;
          $this->smoothg_slideshow = $smoothg_slideshow;
          $this->smoothg_carousel = $smoothg_carousel;
          $this->smoothg_infopane = $smoothg_infopane;
          $this->smoothg_links = $smoothg_links;
          $this->smoothg_slideinfo = $smoothg_slideinfo;
          $this->smoothg_caropacity = $smoothg_caropacity;
          $this->smoothg_caropacitybig = $smoothg_caropacitybig;
          $this->smoothg_carheight = $smoothg_carheight;
          $this->img_image_wd1 = $img_image_wd1;
          $this->img_image_hg1 = $img_image_hg1;
          $this->smoothg_tmbimgwd = $smoothg_tmbimgwd;
          $this->smoothg_tmbimghg = $smoothg_tmbimghg;
          $this->smoothg_tmbimgspacing = $smoothg_tmbimgspacing;
        }
     
        function save($option)
        {
            @chmod ($this->_configFile, 0766);
            $permission = is_writable($this->_configFile);
            if (!$permission) {
                mosRedirect("index2.php?option=$option&act=settings", 'Config file not writeable!');
                break;
            }
            $config = "<?php\n";
            $config .= "\$selectgallery = '" . $_POST['selectgallery'] . "';\n";
            $config .= "\$usertype = '" . $_POST['usertype'] . "';\n";
            $config .= "\$published = '" . $_POST['published'] . "';\n";
            $config .= "\$max_image_size = '" . $_POST['max_image_size'] . "';\n";
            $config .= "\$tmb_image_wd = '" . $_POST['tmb_image_wd'] . "';\n";
          $config .= "\$tmb_image_hg = '" . $_POST['tmb_image_hg'] . "';\n";
          $config .= "\$slaids_text = '" . $_POST['slaids_text'] . "';\n";
            $config .= "\$slaids_wait = '" . $_POST['slaids_wait'] . "';\n";
            $config .= "\$slaids_duration = '" . $_POST['slaids_duration'] . "';\n";
            $config .= "\$slaids_effect = '" . $_POST['slaids_effect'] . "';\n";
            $config .= "\$slaids_transitions = '" . $_POST['slaids_transitions'] . "';\n";
            $config .= "\$slaids_direction = '" . $_POST['slaids_direction'] . "';\n";
            $config .= "\$slaids_tmbcolumn = '" . $_POST['slaids_tmbcolumn'] . "';\n";
          $config .= "\$slaids_tmbrows = '" . $_POST['slaids_tmbrows'] . "';\n";
            $config .= "\$img_image_wd0 = '" . $_POST['img_image_wd0'] . "';\n";
            $config .= "\$img_image_hg0 = '" . $_POST['img_image_hg0'] . "';\n";
            $config .= "\$tmb_image_wd0 = '" . $_POST['tmb_image_wd0'] . "';\n";
          $config .= "\$tmb_image_hg0 = '" . $_POST['tmb_image_hg0'] . "';\n";
          $config .= "\$slaids_textPosTop = '" . $_POST['slaids_textPosTop'] . "';\n";
          $config .= "\$slaids_textPosLeft = '" . $_POST['slaids_textPosLeft'] . "';\n";
          $config .= "\$slaids_textWrapPosTop = '" . $_POST['slaids_textWrapPosTop'] . "';\n";
          $config .= "\$slaids_textWrapPosLeft = '" . $_POST['slaids_textWrapPosLeft'] . "';\n";
          $config .= "\$slaids_textWrapWidth = '" . $_POST['slaids_textWrapWidth'] . "';\n";
          $config .= "\$slaids_textWrapHeight = '" . $_POST['slaids_textWrapHeight'] . "';\n";
          $config .= "\$slaids_textWrapBorder = '" . $_POST['slaids_textWrapBorder'] . "';\n";
          $config .= "\$slaids_textWrapBackground = '" . $_POST['slaids_textWrapBackground'] . "';\n";
          $config .= "\$fe_columnAmount = '" . $_POST['fe_columnAmount'] . "';\n";
     
            $config .= "\$smoothg_delay = '" . $_POST['smoothg_delay'] . "';\n";
            $config .= "\$smoothg_duration = '" . $_POST['smoothg_duration'] . "';\n";
            $config .= "\$smoothg_slideshow = '" . $_POST['smoothg_slideshow'] . "';\n";
            $config .= "\$smoothg_carousel = '" . $_POST['smoothg_carousel'] . "';\n";
            $config .= "\$smoothg_infopane = '" . $_POST['smoothg_infopane'] . "';\n";
            $config .= "\$smoothg_links = '" . $_POST['smoothg_links'] . "';\n";
            $config .= "\$smoothg_slideinfo = '" . $_POST['smoothg_slideinfo'] . "';\n";
            $config .= "\$smoothg_caropacity = '" . $_POST['smoothg_caropacity'] . "';\n";
            $config .= "\$smoothg_caropacitybig = '" . $_POST['smoothg_caropacitybig'] . "';\n";
            $config .= "\$smoothg_carheight = '" . $_POST['smoothg_carheight'] . "';\n";
            $config .= "\$img_image_wd1 = '" . $_POST['img_image_wd1'] . "';\n";
            $config .= "\$img_image_hg1 = '" . $_POST['img_image_hg1'] . "';\n";
            $config .= "\$smoothg_tmbimgwd = '" . $_POST['smoothg_tmbimgwd'] . "';\n";
            $config .= "\$smoothg_tmbimghg = '" . $_POST['smoothg_tmbimghg'] . "';\n";
            $config .= "\$smoothg_tmbimgspacing = '" . $_POST['smoothg_tmbimgspacing'] . "';\n";
            $config .= "?>\n";
            if ($fp = fopen($this->_configFile, "w")) {
                fputs($fp, $config, strlen($config));
                fclose ($fp);
            }
            mosRedirect("index2.php?option=$option&act=settings", 'Settings saved.');
        }
    } // class end
     
    class expgalleryCategories extends mosDBTable {
       var $id = null;
       var $name = null;
       var $url_img = null;
       var $published = null;
     
       function expgalleryCategories(&$db){
          $this->mosDBTable('#__expgallery_categories', 'id', $db);
       }
    } // class end
     
    class expgalleryAds extends mosDBTable {
       var $id   = null;
       var $user_id = null;
       var $cat_id = null;
       var $name = null;
       var $description = null;
       var $date_crt = null;
       var $published = null;
     
       function expgalleryAds(&$db){
          $this->mosDBTable('#__expgallery_ads', 'id', $db);
       }
    } // class end
     
    class expgalleryImg extends mosDBTable {
       var $id = null;
       var $ad_id = null;
       var $url_big = null;
       var $url_img = null;
       var $url_tmb = null;
       var $img_width = null;
       var $img_height = null;
       var $tmb_width = null;
       var $tmb_height = null;
     
       function expgalleryImg(&$db){
          $this->mosDBTable('#__expgallery_img', 'id', $db);
       }
    } // class end 
     
    class ImageOptions {
     
       function isAllowable(&$file, $keyname) {
          $allowable = array ('jpg', 'gif', 'png');
          $extension = substr(trim($file[$keyname]["name"]), -3);
          foreach($allowable as $val) {
             if(strcasecmp($val, $extension) == 0)
                return(1);
          }
          return(0);
       }
     
       function resize($filename, $original, $newx, $newy, $resized, $mod=0) {
          $result = array();
          if(strlen($filename)) {
             if($mod == 0) {
                $filename = substr($filename, 0, strlen($filename) - 4);
                $filename .= "_".mktime();
             }
             if($mod == 1) {
                $filename = substr($filename, 0, strlen($filename) - 4);
                $filename .= "_".mktime()."_t";
             }
          }
          $imagetype = array( 1 => '1', 2 => '2', 3 => '3');
          list($orgWidth, $orgHeight, $type, $attr)  = getimagesize($original);
          if($type == $imagetype[2]) {
             $backup = $resized."/".$filename.".jpg"; // NAME OF BACKUP
             copy ($original, $backup); // COPY SOURCE TO BACKUP
             $source = imagecreatefromjpeg($backup); // CREATE IMAGE IDENTIFIER
             $sourcex = imagesx($source); // GET WIDTH
             $sourcey = imagesy($source); // GET HEIGHT
             if($newy == 0) {
                if($sourcex > $newx) {
                   $newy = round(($newx * $sourcey) / $sourcex);
                }
                else {
                   $newx = $sourcex;
                   $newy = $sourcey;
                }
             }
             $destination = imagecreatetruecolor($newx, $newy); // CREATE A NEW TRUE COLOR IMAGE
             unlink($backup); // DELETE BACKUP FILE
             if(!imagecopyresampled($destination, $source, 0, 0, 0, 0, $newx, $newy, $sourcex, $sourcey)) {
                imagedestroy($source); // FREE MEMORY FROM $source
                imagedestroy($destination); // FREE MEMORY FROM $destination
                return(0); // RETURN ERROR
             } 
             else { 
                imagedestroy($source);
                if(imagejpeg($destination, $resized."/".$filename.".jpg")) { // CREATE RESIZED IMAGE
                   imagedestroy($destination);
                   $result[0]["width"] = $newx;
                   $result[0]["height"] = $newy;
                   $result[0]["name"] = $filename.".jpg";
                   return($result); // RETURN SUCCESS
                }
                imagedestroy($destination);
             }
             return (0);
          }
     
          if($type == $imagetype[1]) {
             $backup = $resized."/".$filename.".gif"; // NAME OF BACKUP
             copy ($original, $backup); // COPY SOURCE TO BACKUP
             $source = imagecreatefromgif($backup); // CREATE IMAGE IDENTIFIER
             $sourcex = imagesx($source); // GET WIDTH
             $sourcey = imagesy($source); // GET HEIGHT
             if($newy == 0) {
                if($sourcex > $newx) {
                   $newy = round(($newx * $sourcey) / $sourcex);
                }
                else {
                   $newx = $sourcex;
                   $newy = $sourcey;
                }
             }
             $destination = imagecreatetruecolor($newx, $newy); // CREATE A NEW TRUE COLOR IMAGE
             unlink($backup); // DELETE BACKUP FILE
             if(!imagecopyresampled($destination, $source, 0, 0, 0, 0, $newx, $newy, $sourcex, $sourcey)) {
                imagedestroy($source); // FREE MEMORY FROM $source
                imagedestroy($destination); // FREE MEMORY FROM $destination
                return(0); // RETURN ERROR
             } 
             else { 
                imagedestroy($source);
                if(imagegif($destination, $resized."/".$filename.".gif")) { // CREATE RESIZED IMAGE
                   imagedestroy($destination);
                   $result[0]["width"] = $newx;
                   $result[0]["height"] = $newy;
                   $result[0]["name"] = $filename.".gif";
                   return($result); // RETURN SUCCESS
                }
                imagedestroy($destination);
             }
             return (0);
          }
     
          if($type == $imagetype[3]) {
             $backup = $resized."/".$filename.".png"; // NAME OF BACKUP
             copy ($original, $backup); // COPY SOURCE TO BACKUP
             $source = imagecreatefrompng($backup); // CREATE IMAGE IDENTIFIER
             $sourcex = imagesx($source); // GET WIDTH
             $sourcey = imagesy($source); // GET HEIGHT
             if($newy == 0) {
                if($sourcex > $newx) {
                   $newy = round(($newx * $sourcey) / $sourcex);
                }
                else {
                   $newx = $sourcex;
                   $newy = $sourcey;
                }
             }
             $destination = imagecreatetruecolor($newx, $newy); // CREATE A NEW TRUE COLOR IMAGE
             unlink($backup); // DELETE BACKUP FILE
             if(!imagecopyresampled($destination, $source, 0, 0, 0, 0, $newx, $newy, $sourcex, $sourcey)) {
                imagedestroy($source); // FREE MEMORY FROM $source
                imagedestroy($destination); // FREE MEMORY FROM $destination
                return(0); // RETURN ERROR
             } 
             else { 
                imagedestroy($source);
                if(imagepng($destination, $resized."/".$filename.".png")) { // CREATE RESIZED IMAGE
                   imagedestroy($destination);
                   $result[0]["width"] = $newx;
                   $result[0]["height"] = $newy;
                   $result[0]["name"] = $filename.".png";
                   return($result); // RETURN SUCCESS
                }
                imagedestroy($destination);
             }
             return (0);
          }
     
          return(0);
       }
     
       /**
        *  GD2 lib
        */
       function checkgd() {
          $tmp_dat = gd_info();
          if(is_array($tmp_dat) && count($tmp_dat) > 3) {
             unset($tmp_dat);
             return (1);
          }
          return(0);   
       }
    }// class end
     
    class pageSort {
       var $prev_row = null;
       var $prev_filter = null;
       var $filter_val = null;
       var $letterlinks = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
       var $numberslink = "0-9";
     
       function pageSort($prev_row, $prev_filter = null) {
          $this->prev_row = $prev_row;
          $this->prev_filter = $prev_filter;
       }
     
       function getListLetters() {
          $html = "";
          $html .= "\t<table class=\"adminlist\">\r\n";
          $html .= "\t<tr><td>\r\n";
          $html .= $this->getLettersLinks();
          $html .= "\t<input type=\"hidden\" name=\"sort_by\" value=\"".$this->prev_row."\" />\r\n";
          $html .= "\t</td></tr>\r\n";
          $html .= "\t</table>\r\n";
          return ($html);
       }
     
       function getFilter() {
          $html = "";
          $html .= "\t<table class=\"adminlist\">\r\n";
          $html .= "\t<tr><td>\r\n";
          $html .= $this->getFilterInput();
          $html .= "\t</td></tr>\r\n";
          $html .= "\t</table>\r\n";
          return ($html);   
       }
       function getLettersLinks() {
          $html = "";
          $start_ch = "[";
          $end_ch = "]";
          $separator_ch = "|";
     
          $html .= "\t<span class=\"pagenav\">".$start_ch."</span>\r\n";
          if($this->prev_row != $this->numberslink && is_numeric($this->prev_row)) {
             $this->prev_row = $this->numberslink;
          }
          if($this->prev_row == $this->numberslink) {
             $html .= "\t<span class=\"pagenav\">".$this->numberslink."</span>\r\n";
          }
          else {
             $html .= "\t<a href=\"#number\" class=\"pagenav\" onClick=\"javascript: document.adminForm.sort_by.value='".$this->numberslink."'; document.adminForm.filter_by.value=''; document.adminForm.submit(); return false;\">".$this->numberslink."</a>\r\n";
          }
     
          $tmp_str = $this->letterlinks;
          for($i = 0; $i < strlen($tmp_str); $i++) {
             if($tmp_str[$i] == $this->prev_row) {
                $html .= "\t<span class=\"pagenav\">".$separator_ch."</span>\r\n";
                $html .= "\t<span class=\"pagenav\">".$tmp_str[$i]."</span>\r\n";
             }
             else {
                $html .= "\t<span class=\"pagenav\">".$separator_ch."</span>\r\n";
                $html .= "\t<a href=\"#".$tmp_str[$i]."\" class=\"pagenav\" onClick=\"javascript: document.adminForm.sort_by.value='".$tmp_str[$i]."'; document.adminForm.filter_by.value=''; document.adminForm.submit(); return false;\">".$tmp_str[$i]."</a>\r\n";
             }
          }
          $html .= "\t<span class=\"pagenav\">".$separator_ch."</span>\r\n";
          $html .= "\t<a href=\"#all\" class=\"pagenav\" onClick=\"javascript: document.adminForm.sort_by.value=''; document.adminForm.filter_by.value=''; document.adminForm.submit(); return false;\">...</a> ".$end_ch."\r\n";
     
          return ($html);
       }
     
       function getFilterInput() {
          $html = "\t<span class=\"pagenav\"><b>Filter:</b> <input class=\"text_area\" type=\"text\" name=\"filter_by\" maxlength=\"20\" size=\"25\" value=\"".$this->prev_filter."\" /></span>\r\n";
          return ($html);
       }
    }// end of class
     
    ?>
    J'ai déjà posté sur un autre forum mais personne ne peut m'aider please HELP ME

  2. #2
    Invité
    Invité(e)
    Par défaut
    Bonjour,
    cherche dans ton code :

    et ajoute leur la qualité (compression) voulue.

    imagejpeg()
    quality est optionnel, et prend des valeurs entières de 0 (pire qualité, petit fichier) et 100 (meilleure qualité, gros fichier).
    Par défaut, la valeur est celle de la qualité IJG (75).
    imagepng()
    Degré de compression : depuis 0 (aucune compression) à 9.
    cela suppose que tu es en PHP 5.1.2 ou +.

    N.B. imagegif() ne permet pas de définir la qualité.

  3. #3
    Candidat au Club
    Femme Profil pro
    Enseignant
    Inscrit en
    Mars 2015
    Messages
    2
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 48
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Enseignant
    Secteur : Conseil

    Informations forums :
    Inscription : Mars 2015
    Messages : 2
    Points : 3
    Points
    3
    Par défaut
    Merci Jreaux,

    Oui ça y est ça marche, on m'a donné un pit coup pouce voilà le bon code :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    if(imagejpeg($destination, $resized."/".$filename.".jpg", 100)) { // CREATE RESIZED IMAGE
    					imagedestroy($destination);
    					$result[0]["width"] = $newx;
    					$result[0]["height"] = $newy;
    Et la qualité est nickel Merci à toi et à @rthur

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Qualité des images redimensionnée dynamiquement
    Par iBen68 dans le forum Windows Presentation Foundation
    Réponses: 0
    Dernier message: 23/11/2012, 16h43
  2. [GD] Qualité d'une image redimensionnée
    Par Akramweb dans le forum Bibliothèques et frameworks
    Réponses: 7
    Dernier message: 10/03/2009, 14h28
  3. Réponses: 10
    Dernier message: 27/01/2008, 16h01
  4. [ImageMagick] Problème de qualité d'image
    Par rigolman dans le forum Bibliothèques et frameworks
    Réponses: 40
    Dernier message: 14/10/2005, 12h38
  5. [image] redimensionnement et sauvegarde.
    Par vasilov dans le forum Interfaces Graphiques en Java
    Réponses: 3
    Dernier message: 22/08/2005, 16h40

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo