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

                    Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

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

                    Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form