JImage - Set generated image quality Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara Support for SchuWebExtensions on JSESimplify image management in articlesSet cookie in from joomla pluginResizing png transparent with JImage, final file not copiedCan dynamic fields generated to form use a jquery event?Joomla Module - Link a Background ImageSet Category and Full Article ImageSetting Specific Session Variable (user specific image folder)JImage - how to get name of thumbnailsMedia component reporting 'Possible IE XSS Attack'J3.8 Module Manager Articles Category generating wrong links

What’s with the clanks in Endgame?

std::is_constructible on incomplete types

A Paper Record is What I Hamper

Could Neutrino technically as side-effect, incentivize centralization of the bitcoin network?

Seek and ye shall find

My admission is revoked after accepting the admission offer

The art of proof summarizing. Are there known rules, or is it a purely common sense matter?

What is it called when you ride around on your front wheel?

Check if a string is entirely made of the same substring

Holes in ElementMesh with ToElementMesh of ImplicitRegion

Arriving in Atlanta after US Preclearance in Dublin. Will I go through TSA security in Atlanta to transfer to a connecting flight?

Why did C use the -> operator instead of reusing the . operator?

How would this chord from "Rocket Man" be analyzed?

Can I criticise the more senior developers around me for not writing clean code?

Do I need to protect SFP ports and optics from dust/contaminants? If so, how?

With indentation set to `0em`, when using a line break, there is still an indentation of a size of a space

Additive group of local rings

Why do games have consumables?

Multiple fireplaces in an apartment building?

Why does the Cisco show run command not show the full version, while the show version command does?

"Whatever a Russian does, they end up making the Kalashnikov gun"? Are there any similar proverbs in English?

Can you stand up from being prone using Skirmisher outside of your turn?

What's parked in Mil Moscow helicopter plant?

How to not starve gigantic beasts



JImage - Set generated image quality



Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar Manara
Support for SchuWebExtensions on JSESimplify image management in articlesSet cookie in from joomla pluginResizing png transparent with JImage, final file not copiedCan dynamic fields generated to form use a jquery event?Joomla Module - Link a Background ImageSet Category and Full Article ImageSetting Specific Session Variable (user specific image folder)JImage - how to get name of thumbnailsMedia component reporting 'Possible IE XSS Attack'J3.8 Module Manager Articles Category generating wrong links










1















I'm using JImage to generate .jpg image thumbnails.



$image = new JImage($image_src);
$resizedImage = $image->cropResize($thumb_width, $thumb_height, true);
$thumb = $resizedImage->toFile(JPATH_BASE.'path/to/photo_thumbnail.jpg', IMAGETYPE_JPEG);


How can I set the generated jpg image quality to 70%?










share|improve this question


























    1















    I'm using JImage to generate .jpg image thumbnails.



    $image = new JImage($image_src);
    $resizedImage = $image->cropResize($thumb_width, $thumb_height, true);
    $thumb = $resizedImage->toFile(JPATH_BASE.'path/to/photo_thumbnail.jpg', IMAGETYPE_JPEG);


    How can I set the generated jpg image quality to 70%?










    share|improve this question
























      1












      1








      1








      I'm using JImage to generate .jpg image thumbnails.



      $image = new JImage($image_src);
      $resizedImage = $image->cropResize($thumb_width, $thumb_height, true);
      $thumb = $resizedImage->toFile(JPATH_BASE.'path/to/photo_thumbnail.jpg', IMAGETYPE_JPEG);


      How can I set the generated jpg image quality to 70%?










      share|improve this question














      I'm using JImage to generate .jpg image thumbnails.



      $image = new JImage($image_src);
      $resizedImage = $image->cropResize($thumb_width, $thumb_height, true);
      $thumb = $resizedImage->toFile(JPATH_BASE.'path/to/photo_thumbnail.jpg', IMAGETYPE_JPEG);


      How can I set the generated jpg image quality to 70%?







      joomla-3.x jimage






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 22 at 5:33









      webchunwebchun

      1,790720




      1,790720




















          1 Answer
          1






          active

          oldest

          votes


















          3














          The third argument in toFile is the options array, which includes 'quality' as a key. eg.



          $thumb = $resizedImage->toFile(JPATH_BASE.'path/to/photo_thumbnail.jpg', IMAGETYPE_JPEG, array('quality' => 70));


          API Doc for Image
          https://api.joomla.org/cms-3/classes/Joomla.Image.Image.html






          share|improve this answer























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "555"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            noCode: true, onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fjoomla.stackexchange.com%2fquestions%2f24515%2fjimage-set-generated-image-quality%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            3














            The third argument in toFile is the options array, which includes 'quality' as a key. eg.



            $thumb = $resizedImage->toFile(JPATH_BASE.'path/to/photo_thumbnail.jpg', IMAGETYPE_JPEG, array('quality' => 70));


            API Doc for Image
            https://api.joomla.org/cms-3/classes/Joomla.Image.Image.html






            share|improve this answer



























              3














              The third argument in toFile is the options array, which includes 'quality' as a key. eg.



              $thumb = $resizedImage->toFile(JPATH_BASE.'path/to/photo_thumbnail.jpg', IMAGETYPE_JPEG, array('quality' => 70));


              API Doc for Image
              https://api.joomla.org/cms-3/classes/Joomla.Image.Image.html






              share|improve this answer

























                3












                3








                3







                The third argument in toFile is the options array, which includes 'quality' as a key. eg.



                $thumb = $resizedImage->toFile(JPATH_BASE.'path/to/photo_thumbnail.jpg', IMAGETYPE_JPEG, array('quality' => 70));


                API Doc for Image
                https://api.joomla.org/cms-3/classes/Joomla.Image.Image.html






                share|improve this answer













                The third argument in toFile is the options array, which includes 'quality' as a key. eg.



                $thumb = $resizedImage->toFile(JPATH_BASE.'path/to/photo_thumbnail.jpg', IMAGETYPE_JPEG, array('quality' => 70));


                API Doc for Image
                https://api.joomla.org/cms-3/classes/Joomla.Image.Image.html







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 2 days ago









                jamesgarrettjamesgarrett

                2,5191511




                2,5191511



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Joomla Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fjoomla.stackexchange.com%2fquestions%2f24515%2fjimage-set-generated-image-quality%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                    Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

                    Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?