[Resolved] Page Header Image Location

Home Forums Support Page Header Image Location

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #38436
    Fabio Reinhardt

    I have hit a problem concerning the file system location of page header images. Currently, the page header addon assumes them to be at document_root + relative http path. This is not a safe assumption, since there might be web server rewrites in play. In our case, the WordPress files are located in a sub directory, but are transparently rewritten to / by nginx. The current assumption causes the resizing / crop routine to fail (the files are not found, since the image editor looks for them in /wp-content/… instead of /wordpress/wp-content/…).

    A better approach might be to handle internal WordPress attachments and other, url-based image references differently. Attachments should be referenced by their attachment id, since WordPress already knows their file system location. No guess work needed. 😉 It can be retrieved using get_attached_file($id). This should also work for multisite.

    The attachment id is readily available via the wp.media api (attachment.id), so I would be glad if you could take a shot at fixing this issue.

    Thanks,
    Jan Ortgies
    – MdA Fabio Reinhardt –

    #38443
    Tom
    Lead Developer
    Lead Developer

    Thanks for the info – I’ll research a solution!

    Really appreciate it 🙂

    #46952
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Just letting you know that I’ve changed the script that handles resizing to the popular BFI Thumb script, found here: https://github.com/bfintal/bfi_thumb

    It offers an option to change the directory the images are uploaded to.

    Hopefully this fixes the problem you were having.

    Thanks!

    #53180
    Fabio Reinhardt

    Worked right out of the box now, thanks! 🙂

    Jan Ortgies
    – MdA Fabio Reinhardt –

    #53181
    Tom
    Lead Developer
    Lead Developer
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.