• Resolved stuarthardy

    (@stuarthardy)


    I have an image of original size 1746 x 2162, which I’ve inserted into a child page. WordPress creates three images in my uploads directory named image-[this]x[that].jpg, in line with my default media sizes, in addition to the original file (image.jpg).

    After I navigate to the parent page with the autonav tag, a fifth image file has been created in the uploads directory, with filename image-201×250.jpg. However, I expected a cropped image of 250 x 250, as specified in the autonav admin options.

    When I look at the source HTML of my autonav parent page, the image src= has been specified as the filename above, with width=250 and height=250.

    If I manually create a file called image-250×250.jpg of the correct required cropped dimensions and drop this into the uploads directory via FTP, with absolutely no other tweaking the image on the autonav parent page is displayed as the square cropped version that I wanted.

    I’ve tried disabling all other plugins (didn’t work) and switching to the default twentyten theme (couldn’t see why it might help and it didn’t make any difference anyway). Tried changing the “Crop images to size?” setting in admin options, saving changes, then changing it back. Tried using crop=1 in the tag itself.

    It seems that the plugin always creates its own image files in “fit to size” mode, no matter what I do. Yet it’s smart enough to display the image-250×250.jpg file if it finds it there.

    I might be missing something really obvious, but I can’t see what’s wrong. Unless it’s my expectations… but “cropped” means cropped (rather than proportionally resized), right?

    Plugin version 1.3.7, by the way.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter stuarthardy

    (@stuarthardy)

    Following on from the above, if I set the Autonav “Automatic image sizing” parameters to 150×150 (i.e. the same as my default WordPress thumbnail size, specified in Settings, Media), Autonav displays consistent square thumbnails for every image, as expected.

    I’ve checked out the plugin code and, while I’m no programmer, I can see that this is consistent with the way the plugin works – it looks for the correct size of image first (as defined by filename) before creating one itself. These images already exist.

    Still trying to work out why it isn’t creating the cropped images when they don’t exist. Not simply failing to creating them (which could be a permissions issue), but creating scaled images instead.

    Plugin Author wlindley

    (@wlindley)

    Try this please. At approximately line 258 you will add the line: $pic_info['crop'] = $attr['crop']; above the call to resize_crop as shown below. Note, there is an identical comment in a previous stanza on about line 232; do not change that one, only the one with below if statement exactly as shown here.

    if ($pic_info['pic_thumb'] == '') {
            // properly sized full image does not exist; create it
            $pic_info['crop'] = $attr['crop'];
            resize_crop($pic_info, 'thumb'); // creates ['pic_thumb'], ['pic_thumb_url'] in $pic_info
          } else {
            $pic_info['pic_thumb_url'] = trailingslashit($wp_dir['baseurl']) . $pic_info['pic_thumb'];
          }
    Thread Starter stuarthardy

    (@stuarthardy)

    Perfect! That fixed it. Thanks.

    Also thanks in general for a great plugin. The more I explore its features, the more I appreciate its capabilities.

    Plugin Author wlindley

    (@wlindley)

    Most welcome. Correction is in trunk, will be in next release.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: AutoNav Graphical Navigation and Gallery Plugin] Cropping not working?’ is closed to new replies.