尊龙凯时人生就是搏

thinkphpÔõôÉèÖÃͼƬÖÊÁ¿

×÷ΪһÃû¿ª·¢Õߣ¬ÎÒÃÇÔÚÍøÕ¾¿ª·¢Öо­³£»áʹÓÃͼƬÀ´¸»ºñÒ³ÃæÄÚÈÝ¡£¿ÉÊÇ£¬µ±ÎÒÃÇÔÚʹÓÃͼƬµÄͬʱ£¬Ò²ÐèҪעÖØͼƬµÄ¾ÞϸºÍÖÊÁ¿ÎÊÌâ¡£ÓÉÓÚ¹ý´ó»òÕßÖÊÁ¿²»¸ßµÄͼƬ»áÓ°ÏìÍøÕ¾µÄÐÔÄܺͼÓÔØËÙÂÊ£¬Õâ¹ØÓÚÓû§ÌåÑéÀ´ËµÊÇÒ»¸öµ¹Ô˵ÄÒòËØ¡£

¶ø¹ØÓÚʹÓÃthinkphp¿ò¼ÜµÄ¿ª·¢ÕßÀ´Ëµ£¬ÔõÑùͨ¹ý´úÂëÀ´¿ØÖÆͼƬµÄ¾ÞϸºÍÖÊÁ¿ÊÇÒ»ÏîÖ÷ÒªµÄÊÖÒÕ¡£ÏÂÃæ¾ÍÈÃÎÒÀ´·ÖÏíÒ»ÏÂthinkphp¿ò¼ÜÖÐÔõÑùÉèÖÃͼƬÖÊÁ¿µÄÒªÁì¡£

ÔÚthinkphp¿ò¼ÜÖУ¬ÎÒÃÇ¿ÉÒÔʹÓÃͼƬ´¦Àí¿âÀ´²Ù×÷ºÍ´¦ÀíͼƬ¡£ÆäÖУ¬Think\ImageÀà¿ÉÒÔ×ÊÖúÎÒÃÇÍê³É´¦ÀíͼƬµÄ¹¦Ð§¡£¶øÔÚʹÓÃThink\ImageÀàʱ£¬ÎÒÃÇ¿ÉÒÔͨ¹ýsetQuality()ÒªÁìÀ´ÉèÖÃͼƬµÄÖÊÁ¿¾Þϸ¡£

setQuality()ÒªÁìµÄʹÓ÷½·¨ÈçÏ£º

use think\Image;

...

$image = Image::open('image.jpg');

$image->setQuality(50);

$image->save('new_image.jpg');

µÇ¼ºó¸´ÖÆ

ͨ¹ýÕâ¸öÒªÁ죬ÎÒÃÇ¿ÉÒÔ½«Í¼Æ¬µÄÖÊÁ¿ÉèÖÃΪ50£¬È»ºó½«´¦ÀíºóµÄͼƬÉúÑÄΪnew_image.jpg¡£

Á¬Ã¦Ñ§Ï°¡°PHPÃâ·ÑѧϰÌõ¼Ç£¨ÉîÈ룩¡±£»

ʹÓÃsetQuality()ÒªÁì֮ǰ£¬ÎÒÃÇÐèÒªÏÈʹÓÃImage::open()ÒªÁìÀ´·­¿ªÒª´¦ÀíµÄͼƬ¡£È»ºó£¬¶ÔͼƬ¾ÙÐÐÖÊÁ¿Ð޸ĺó£¬ÎÒÃÇÐèҪʹÓÃsave()ÒªÁ콫Ð޸ĺóµÄͼƬÉúÑĵ½Ö¸¶¨µÄ·¾¶Ï¡£

ÔÚÉèÖÃͼƬÖÊÁ¿Ê±£¬ÎÒÃÇÐèҪעÖØÒÔϼ¸µã£º

ÉèÖõÄͼƬÖÊÁ¿ÖµÔ½Ð¡£¬Í¼Æ¬µÄÎļþ¾ÞϸҲ¾ÍԽС¡£¿ÉÊÇ£¬ÖÊÁ¿Öµ¹ýµÍ»áÓ°ÏìͼƬµÄÇåÎú¶ÈºÍ¾«¶È¡£

ÔÚ´¦ÀíͼƬʱ£¬ÎÒÃÇÐèҪƾ֤ҳÃæÒªÇóºÍÐèÒªµÄÇåÎú¶ÈÀ´Ñ¡ÔñºÏÊʵÄÖÊÁ¿Öµ¡£

ÈôÊÇͼƬµÄÖÊÁ¿ÒѾ­ºÜ¸ß£¬ÄÇôÔÙ¶ÔÆä¾ÙÐÐѹËõ´¦Àí¿ÉÄܻᵼÖÂͼƬʧÕæ¡£

ͨ¹ýʹÓÃsetQuality()ÒªÁ죬ÎÒÃÇ¿ÉÒÔÇáËɵؿØÖÆͼƬµÄÖÊÁ¿¾Þϸ£¬´Ó¶øÌá¸ßÍøÕ¾µÄÐÔÄܺͼÓÔØËÙÂÊ£¬Í¬Ê±Ò²°ü¹ÜÁËÓû§ÌåÑ顣ϣÍû±¾ÎĶÔÄãÓÐËù×ÊÖú¡£

ÒÔÉϾÍÊÇthinkphpÔõôÉèÖÃͼƬÖÊÁ¿µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí£¬°æȨÕùÒéÓë±¾Õ¾Î޹أ¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í尊龙凯时人生就是搏ÂËÓÍ»úÍø¹Ù·½Ì¬¶È£¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ£¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢£¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢£¬ÇëÄúÁ¬Ã¦ÁªÏµ尊龙凯时人生就是搏ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是搏

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎ壬9:30-18:30£¬½ÚãåÈÕÐÝÏ¢

QR code
sitemap¡¢ÍøÕ¾µØͼ