JImage - Set generated image quality Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) 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

Inverse square law not accurate for non-point masses?

Plotting a Maclaurin series

Hide attachment record without code

Any stored/leased 737s that could substitute for grounded MAXs?

How do Java 8 default methods hеlp with lambdas?

New Order #6: Easter Egg

How do you cope with tons of web fonts when copying and pasting from web pages?

Getting representations of the Lie group out of representations of its Lie algebra

How to get a flat-head nail out of a piece of wood?

malloc in main() or malloc in another function: allocating memory for a struct and its members

Combining list in a Cartesian product format with addition operation?

calculator's angle answer for trig ratios that can work in more than 1 quadrant on the unit circle

Searching extreme points of polyhedron

Why does BitLocker not use RSA?

Proving that any solution to the differential equation of an oscillator can be written as a sum of sinusoids.

Did John Wesley plagiarize Matthew Henry...?

"Destructive power" carried by a B-52?

Pointing to problems without suggesting solutions

Does the universe have a fixed centre of mass?

How to ask rejected full-time candidates to apply to teach individual courses?

By what mechanism was the 2017 UK General Election called?

What is a more techy Technical Writer job title that isn't cutesy or confusing?

Does the main washing effect of soap come from foam?

Is the Mordenkainen's Sword spell underpowered?



JImage - Set generated image quality



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
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 3 hours ago









      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 1 hour 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

                    Isabella Eugénie Boyer Biographie | Références | Menu de navigationmodifiermodifier le codeComparator to Compute the Relative Value of a U.S. Dollar Amount – 1774 to Present.

                    Join wedge with single bond in chemfigHow to make only one part of double bond bold with chemfig?Crossing bonds in chemfigjoining atoms in chemfig. Two adjacent molculesHow do I selectively change bond length in chemfig?Ugly bond joints in chemfigchemfig: reaction above arrowUsing the mhchem and chemfig packages in conjunctionBonding to specific element letter using chemfigResonance hybrids in chemfigScale chemfig molecule in beamer with tikzWhy does this chemfig bond with a hook start in the middle of the atom?

                    Compiling documents onlineAre any web base TEX editors with live collaboration available?Is there a web-based LaTeX or TeX editor?Creating a PDF file online from a LaTeX templateAre there any online LaTeX editors that provide the latest packages?Comparison of browser-based latex processorsCan I find something like this online?Is there a site where I can enter a latex expression, and it shows me an image of the compiled expression?Automatic online compiling systemA resource for converting LaTeX within the browserIs there an equivalent of jsfiddle for LaTeX?Online LaTeX syntax highlighterComparison of browser-based latex processorsDo the online LaTeX compilers use a TeX daemon to speed up their compilation?Undefined control sequence documentclassLaTeX Syntax Highlighting in Google DriveWhy are my Latex compile times varying massively?Online compilation with commercial fontsCompiling multiple LaTeX filesSlow compiling of large documents in TeXstudiodocument not compiling with custom .cls