I just wanted to follow up on this, since I was able to determine what the problem was in my case. Unfortunately in my case it did require modifying the plugin code, even though technically it’s not a bug in the plugin, but a conflict with my theme.
The problem is that both my theme and this plugin are hooking into the image_resize_dimensions
filter with priority 11. My theme ended up overwriting the cropping settings specified by this plugin.
I can’t lower the priority on my theme though (for the same reasons it’s set to 11 in this plugin).
The only way I was able to address the issue was to modify the plugin and make the priority higher. I went for a nice high “99” as my new priority level.
The change is in the file includes/class-meauh-attachment.php
, line 42.
Here’s the original version:
add_filter( 'image_resize_dimensions', array( $self, 'crop' ), 11, 6 );
I just needed to change the “11” to “99” (or really, probably anything 12 or higher, but I wanted to make sure this plugin was definitely working and not getting overridden by another later filter).
add_filter( 'image_resize_dimensions', array( $self, 'crop' ), 99, 6 );
Sadly I think the developer may have abandoned this plugin, but if not, I would like to propose making this change in the official version. After I made this change, it once again worked perfectly.
Well, almost. Along the way I did notice something peculiar. I think that the plugin is actually taking the hotspot x
and y
coordinates from the upper left corner of a square that would enclose the pink circle of the hotspot, rather than from its center. It looks to me like the crop()
method should be accounting for the width
of each hotspot as well as its x
and y
values, and adding 1/2 of that to get the center point of each hot spot. That’s from doing some diagnostic logging on the processing in the function, but it’s also borne out in my observations when I added a single hotspot to an image. It worked, but it still seemed cropped a bit more towards the upper left of the image than it should’ve been, given the placement of the hotspot in the lower right area of the image.