Support » Plugin: File Away » Thumbnails For Image Files

Viewing 15 replies - 1 through 15 (of 26 total)
  • I placed a request with Thom for this enhancement. It is under consideration.

    Plugin Author thomstark

    (@thomstark)

    I’ve got this up and running but I’m not willing to release it at this stage. Large image files max out even large php.ini memory_limits and cause the script to return a broken img thingy. I suppose I could do a filesize check and if it’s over a certain size, it will return the filetype icon instead of producing the virtual thumbnail. What do you think?

    Hi Thom,

    Super excited to hear this is happening (nearly) What if you check the image size before you make thumb nails? Say 1024 max dimension (1024×1024 pixels max).

    Plugin Author thomstark

    (@thomstark)

    OK. I’m done with the functionality and the CSS styling. I just have to add the new options to the shortcode generator and the tutorials tabs.

    You will first enable thumbnails with thumbnails=true

    You will then get another five options that will come up if true is selected. The first three will be used to determine whether we generate the thumb or not on page load:

    maximgbytes, maximgwidth, maximgheight

    These will have defaults (I’m thinking, 1887436.8, i.e. 1.8MB, 3000, 2500.) if you leave those atts out of the shortcode. Or you can specify your own. You’ll have to specify the maximgbytes in bytes though, a pure integer, not 2MB or something. (Just cause I don’t want to have to run a function to convert it myself, thus creating that much more overhead.)

    So it will compare the settings for those three with the bytes, width and height of each image, and if the image is bigger in at least one of three respects, it will output the filetype icon, not the thumbnail.

    That way you can fine tune it on a per table basis, if you’re picky like that.

    The other two attributes you will have will be:

    thumbstyle, graythumbs

    thumbstyle has a fixed set of options: widerounded, widesharp, squarerounded, squaresharp, oval, and circle. If it’s a wide or oval, the width of the generated thumb will be 1.5 times the height. Otherwise, height/width same.

    graythumbs=true will turn the thumbnails black and white. Leave it out of the shortcode for their native color.

    Except this within a day or so.

    Plugin Author thomstark

    (@thomstark)

    I should also mention that if in your php.ini file your memory_limit setting is low, that is what will cause it to give up and give you a broken image thingy for large images. But if you set your memory_limit too high, that can cause problems in other respects. So you want a balance, and those three shortcode atts for testing against each image will help fine tune it.

    Hi Thom,

    Thanks so much for working on this and this plug in in general. Looking forward to taking it for a drive!

    Plugin Author thomstark

    (@thomstark)

    Version 2.2 is now up with thumbnails as an option for tables.

    Hi Thom,

    I see the options appear in the Code Generator but when I add the code to the page it doesn’t add the new image options.

    Plugin Author thomstark

    (@thomstark)

    Which options in particular? It won’t add them if they’re already the default (ie, dropdown text in red.)

    Plugin Author thomstark

    (@thomstark)

    and by the way, what I stated above has changed for clarity.

    it’s maxsrcbytes, maxsrcwidth, maxsrcheight, instead of maximg*

    Plugin Author thomstark

    (@thomstark)

    Maybe try clearing your browser cache? Last resort for the time being, the atts and options are covered at the bottom of the shortcode attributes table on the tutorials tab.

    I think it me not choosing the options correctly. I’m getting a broken page image for my thumb nails now so I’m nearly there. my code looks like this: [fileaway type="table" heading="File Directory" hcolor="blue" thumbnails="true" directories="anything" maxsrcbytes="3774873.6" thumbstyle="squaresharp"]

    Plugin Author thomstark

    (@thomstark)

    Great, just start reducing your maxsrcbytes or maxsrcwidth or maxsrcheight until all the broken links go away. Whichever one is the last to go away is your threshold.

    Plugin Author thomstark

    (@thomstark)

    And remember you can adjust your memory_limit setting in your php.ini to help as well, just don’t make it too big. I don’t recommend anything over 512M, but 256M will probably be the help you need.

    Plugin Author thomstark

    (@thomstark)

    If your maxsrcbytes is set to 3.6M as yours is, even if you set your memory_limit to unlimited (DONT DO THAT), it’s going to take the page a while to load. Not very efficient.

Viewing 15 replies - 1 through 15 (of 26 total)
  • The topic ‘Thumbnails For Image Files’ is closed to new replies.