Forum Replies Created

Viewing 15 replies - 1 through 15 (of 29 total)
  • can you tell me what you are doing when this error is thrown? it sounds like a situation where a nonexistent image is accidentally sent to media.php, but not sure where that would happen in smartcrop.

    Bedrock shouldn’t cause a problem. smartcrop can handle changes to the wp-content path.

    That unlink warning happens when smartcrop tries to regenerate one of the sized versions of an image, and the thumbnail it is replacing doesn’t exist. it doesn’t prevent the plugin from working, but it can be indicative that images aren’t being generated in the right spot. It can also just mean that a thumbnail size was added after that image was uploaded.

    In any event, it sounds like everything is working for you now, so I’m gonna mark this as resolved. Let me know if anything else pops up.

    I just pushed an update that should fix many of these warnings, however the unlink warning seems to be legitimate.

    Let me know if this helps

    I think most of these can be traced to a typo on line 225 that ends up wrapping an entire conditional in count(), instead of just one term. The issue with unlink(), however, looks like it might be related to the configuration of your install… are you using s3 offload, or a similar plugin to host your image files in a non-standard location?

    I’m looking into that typo now.

    • This reply was modified 6 years, 9 months ago by wpsmartcrop.

    This should be resolved with the new version. By default the focal point is now centered. and there is a filter available to change the default, where necessary.

    This issue should now be resolved with the new version.

    Thanks for the heads up… I’ll try to get a bugfix version rolled within the next few days.

    ah, finally realized the issue is with the quick-link to settings on the plugins page, rather than the settings page itself (under tools). This should be solved in the new version I just pushed.

    The new version has just been committed (took a bit longer than expected), and there is now a proper jquery plugin devoted to processing wp-smartcrop images

    This should be fixed in the latest version. Actually, array sizes should be set as cropped by default, and should never hit that code, as we can’t know for sure what size wordpress will return without further processing.

    I’ll see if they need to be revisited at a future date.

    can you let me know what version of PHP you’re running?

    in any event, the settings page is actually unneccessary for the usage of smartcrop. you can enable smartcropping on any image in the media library, right from the details view. It’s worth checking out https://www.wpsmartcrop.com/how-does-it-work/ for step by step usage

    This particular plugin seems to be a nightmare for trying to solve this problem, as it doesn’t even set the background image as an attribute of the header, but instead as a separate css style in the header. I highly doubt that you’d be able to retrofit the plugin in question to support wpsmartcrop without working closely with the plugin developer.

    However, the actual task of adding a full-width header image seems relatively easy to do in your template directly, by using the featured image, and simply outputting it into a full-width <header> tag, followed by any content you want inside.

    Then you could simply use the absolute positioning method I mentioned above, to get the style you’re looking for.

    But yeah, I don’t think integration is going to be possible with this specific plugin.

    the data-smartcrop-focus can’t be added from jQuery alone, because the attribute contains a set of percentages for the x and y coordinates of the focus that are stored in the database as image-meta values. You’ll need to modify the php code that outputs the url for the background image to also output the focus. As it is, jQuery has nowhere to grab the data from.

    This is definitely not a mod that you’ll be able to accomplish without making modifications to your theme. If you can provide a link to a site running this theme, I can look into the complications involved in retrofitting for smartcrop, but there is no general purpose solution for this.

    Background images are pretty much guaranteed to require some custom code to implement. as WordPress has no standard way to output HTML for a container with a background image.

    My first suggestion would be to not use background images at all, and instead just add your image as the first child of your container, and use position: absolute; top:0;left:0;width:100%;height:100%;, and make sure position is set on the parent element. That way, SmartCrop can work as expected.

    I’m doing some major rewrites for the next version, and will attempt to add javascript support for background images in the process, but you will still need some custom scripting to initialize the plugin for these elements and provide it with some necessary data about the image.

    The JavaScript is enqueued with the footer flag set to true, so in properly coded themes, it will render in the footer, not blocking DOM loading. It only potentially blocks other external scripts, which is generally considered standard practice for scripts that have dependencies such as jQuery. This is because load order must be preserved. Async loading that preserves execution order is not well supported (in fact, IE is the only supporting browser), and is certainly not supported by WordPress’s best practices.

    If you are attempting to shorten load times, this mark from Google is likely a red herring, and not the underlying cause of any perceived slowness. I would suggest looking at server response times, resource sizes, and number of includes as much more important factors than a couple of kilobytes of JavaScript.

    In terms of minifying and combining your css and JS, there are plenty of plugins such as T3, Autoptimize, and Better WordPress Minify that you could look at to combine all your external resources into single files. However, none of these work well without significant manual tweaking.

Viewing 15 replies - 1 through 15 (of 29 total)