Support » Plugin: Imsanity » Imsanity and problem with Twentyten backgrounds

  • Resolved janiu



    Thanks for the great plugin. It works perfectly on a multisite with hundreds of bloggers uploading huge images for their posts.

    But there’s also one problem. We’re using Twentyten theme and when uploading a background image for the theme Imsanity also resizes that. We want to allow background images to be 1800px wide but restrict images for posts to be 800px.

    Is it possible to modify the plugin so that it only resizes images uploaded while making a blog post?


Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Jason


    Hmm that’s interesting. I’ll have to see a couple of thing.

    First whether that information is even available within the function that Imanity hooks into. Surely it’s available somewhere but within that function scope I don’t know if the information is there as far as the source of the upload.

    The second thing I guess is how many unique places are there to upload files and how to identify them. I know of pages, posts and the media library. Anything else might be considered a “plugin”

    If I were to create a setting for “media library” and then a setting for “everything else” it could open up the possibility for large uploads if a plugin implements upload functionality. That probably does tend to be theme header images, logos, etc, but could be anything.

    It would be a great solution to let the admin choose whether to resize:
    a) All uploads

    or only (with check boxes)
    b) Posts & Pages
    c) media library

    This way I could check b and c options and it would resize everything except the uploads by plugins and themes.

    Plugin Contributor Jason


    For the moment the best workaround is to either temporarily disable Imsanity or increase the limit so the header isn’t scaled. The imsanity default is 1024×1024 so it shouldn’t scale the Twentyten theme header image (1000×330). Setting the width/height to zero will also tell Imsanity not to resize.

    So far I’ve had no luck finding out where an upload originates at the level where Imsanity hooks into the process. I know it’s possible to hook in at a later point but then WordPress has already done some voodoo (generated smaller images, inserted db records for those, etc). That means Imsanity would then have to inspect and undo things, remove files and db records. That makes things a bit more complicated.

    Considering there’s a couple of workarounds I probably will keep this on the back burner. If some people can make a good case for it, I’ll definitely be listening.

    I do have a support request here if anybody knows an answer –

    Thanks for trying! The problem is not actually the headers but the background images that might be around 1800px wide. Putting the Imsanity limit there is one option but that won’t save so much space as preferred for the other images…

    I don’t know the logic behind this so well, but could be possible somehow for the plugin to check from the url whether it should hook the uploading or not?


    Plugin Contributor Jason


    That’s not a bad idea. Though it’s not really the “WordPress way” since they don’t offer any api calls to get that info (that I know of) and there’s no guarantees about filenames or querystrings remaining unchanged. I’ll check it out, though.

    Plugin Contributor Jason


    i figured out a way to make it work. I just released version 2.1.0 and you can set different sizes for the images by post, library or “other”

    You’re great! It’s working, now I can let the users add larger backgrounds but restrict the original image sizes in posts.


    Plugin Contributor Jason


    awesome! there is a small chance it could change in a future wordpress release if they change the form parameters, since there was no api to use. but worst-case scenario it will just fall back to the “other” setting for all images.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Imsanity and problem with Twentyten backgrounds’ is closed to new replies.