We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37758
    • 73 Posts
    Hi,

    I have done searching around but it seems there is no image resizer available for ModX. I have seen directresize but that's only front-end. I have seen imagetv+ but that requires a user to be fully comfortable with TVs and then also insert 'weird' things into the content. It also means that this is limited to the number of images that can be inserted into a document.

    Is there anyone who knows if a simple resizer is planned or in development? My clients really struggle with understanding and resizing images and I am sure I am not the only one who's clients find this difficult? I am thinking resize on upload or being able to set some standard sizes as an admin and users then being able to pick from those, something like that?
      • 5160
      • 118 Posts
      Old thread I know but maybe this will still help you or anyone finding it via search.

      You don't say if you require this functionality for TinyMCE where clients may upload a massive image then resize it with the grab handles thinking it works like Microsoft Word. If this is the case take a look at the AutoFixImageSize extra by gerritvanaaken:
      http://modx.com/extras/package/autofiximagesize

      Auto-detects every img element and checks if the width/height attributes match the physical size of the image file. Generates a correctly sized version of the image (via phpThumbOf) and fixes the src attributes. Works especially well with TinyMCE’s image insertion.

      This extra requires the phpThumbOf extra to be installed.

      If your clients are uploading images into TV fields then take a look at phpThumbOf on its own, or one of the more recent similar extras.

      With this installed you can apply an output modifier to the TV field in which you can specify dimensions for the stored image to be resized to so instead of:
      <img src="[[*tvImage]]" />


      You could have:

      <img src="[[*tvImage:phpthumbof=`w=120&h=120`]]" />


      More detail about other parameters such as Zoom Control are noted at:
      http://www.belafontecode.com/image-manipulation-with-phpthumbof-in-modx-revolution/

      phpThumbOf won't stop the client uploading hundreds of MB of image files but it can be used to stop MODX serving them up on a website.
        • 1343 ☆ A M B ☆
        • 2,213 Posts
        I've seen AutoFixImageSize crash several servers, and would only recommend it for use in a development environment. If you are looking for something to use on a production site then consider using pThumb and ImageSlim.

        pThumb: http://modx.com/extras/package/pthumb
        ImageSlim: http://modx.com/extras/package/imageslim

        The rough performance data on pThumb (with Resizer - part of package) would suggest this is a solid high performance solution, with the test (https://github.com/oo12/phpThumbOf/wiki/Thumb-War) coming back in 5.87 seconds vs over 80 seconds with other solutions (over 90 for phpThumbOf!).

        There isn't a good on upload solution that I know of currently, but those two should help keep your clients images in check.

        You could also try using ResizeImageOnUpload: http://modx.com/extras/package/resizeimageonupload2 I haven't tried it so your mileage may vary some.
          Patrick | Server Wrangler
          About Me: Website | Tweets |  MODX Hosting
          • 28120
          • 380 Posts
          AutoFixImageSize works fine for me although I'm using it with pThumb as the base instead of phpThumbOf
            • 37758
            • 73 Posts
            Hi,

            Thanks for your replies, appreciate it - I have looked at those but am not sure that those are right. I am more after something like you find in Wordpress, with a little more control: uploading images, deciding on some preset sizes, ability to crop iamges, etc. With the solutions you have mentioned, I feel these are more about fixing things afterwards, rather than getting it right in the first place?