[wp-trac] [WordPress Trac] #15149: image_get_intermediate_size partly ignores 'path' and 'url' fields and has inconsistent return values
WordPress Trac
wp-trac at lists.automattic.com
Thu Oct 21 10:10:47 UTC 2010
#15149: image_get_intermediate_size partly ignores 'path' and 'url' fields and has
inconsistent return values
-------------------------+--------------------------------------------------
Reporter: whoismanu | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 3.1
Severity: normal | Keywords: has-patch
-------------------------+--------------------------------------------------
Comment(by Denis-de-Bernardy):
Well, the reason I asked is I wrote a plugin (Uploads Folder) which
tinkers around with these pieces of data and moves files around in the
uploads folder to reflect the URL of whichever piece of data they're
attached to. And no later than yesterday, I was writing a different one
which organizes files as so:
- wp-content/images/fullsize
- wp-content/images/midsize
- wp-content/images/thumbnails
- wp-content/videos
- etc., while keeping the existing date or URL-based organization, if
any.
Both plugins cater to the need of access-restricting some files but not
others.
Both are a bit hacky, in the sense that I had to make do with the lacking
of the API, but they work.
To be frank, the key points that bothered me had more to do with missing
filters than with anything. In particular:
- the thumbnail URL filter isn't always applied (image downsize needs to
be used in some cases to work around this)
- filters are missing to properly change where the file gets stored
without things interfering with file deletion when attachments are
deleted.
- the send to editor filters are inconsistently applied throughout the
application.
- hard-coded links in posts aren't automatically changed when attachment
file urls change, leading me to think that some URL rewriting would be
welcome to abstract this stuff in posts.
Getting back to your patch, it seems to me that we should also (or at
least) split _wp_attached_file and the resulting meta in two, so the
subfolder can be filtered based on the file being displayed. And the same
for what is returned by wp_uploads_dir() -- the latter currently lacks
context. This would also beak backwards compatibility, but in a way that
makes things, I suspect, more flexible when we mess around with uploaded
files.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/15149#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list