Opened 17 years ago
Closed 9 years ago
#6430 closed enhancement (fixed)
WordPress 2.5 xmlrpc should return image thumbnail URLs in wp.uploadFile
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | 2.5 |
Component: | XML-RPC | Keywords: | has-patch |
Focuses: | Cc: |
Description
The xmlrpc call for wp.uploadFile (aliased to mw_newMediaObject) currently returns the URL of the uploaded file only. In WordPress 2.5, thumbnail files are automatically created. The xmlrpc API should provide a way to get the URLs of the thumbnail files, preferably in the returned hash from the wp.uploadFile call.
That is, wp.uploadFile currently returns url = "http://myhost/wp/wp-content/uploads/2008/03/myImage.jpg". In addition, it should return "thumbnailSmallUrl = ..." and "thumbnailMediumUrl = ...". (I'm not sure if this would break MetaWeblog compatibility.)
Background:
WordPress 2.5 now automatically creates thumbnail images for uploaded image files according to the (maximum) sizes specified in the Miscellaneous settings page. When resizing, the aspect ratio is maintained, and the filenames are named for the exact size of the image. For example, if I upload:
dsc-0151.jpg
Using the default thumbnail settings of 150x150 and 300x300, these files will be created:
dsc-0151-300x199.jpg
dsc-0151-150x150.jpg
Note that the first filename for the medium thumbnail is called "300x199" not "300x300". It's thus difficult to guess the new thumbnail filename for the default settings.
Since these settings are user configurable, it's currently impossible for an xmlrpc client to guess the URLs of the thumbnails.
Attachments (5)
Change History (20)
#1
@
17 years ago
- Cc josephscott added
- Component changed from General to XML-RPC
- Type changed from defect to enhancement
#5
@
15 years ago
- Cc jonquark added
- Keywords has-patch added; needs-patch removed
- Owner changed from anonymous to jonquark
- Status changed from new to accepted
It's my first Wordpress patch, please review it harshly.
#6
@
15 years ago
I've created a (hopefully) temporary plugin to add this functionality:
http://wordpress.org/extend/plugins/imageurlreturner/
until this item is closed.
#7
@
15 years ago
I've just updated the patch so it now applies to trunk revision 15490 (checked out this evening).
Now 3.0 is out and stable, is now a good time to ask for this patch to be applied?
#8
@
14 years ago
I've added another version of the patch (against rev. 15853).
In addition to keeping up with trunk changes, I've fixed a problem where the urls weren't returned correctly when two files of the same name were uploaded to the server.
(Thanks to multiple people for pointing out the problem which they encountered using the plugin equivalent to this patch).
I'd be really grateful if the patch could be applied...
#9
@
14 years ago
v4 of the patch now added
(v3 of the patch had inadvertent changes due to mistaken forward porting from the original patch)
#10
@
14 years ago
Perhaps we should look at returning the same set of data provided by the new wp.getMediaItem method - #15151
#11
@
13 years ago
I've added a new patch to benefit from the work that has been done in 3.4.
The deprecated values its a little bit ugly but I guess this is the only way to make things the same trough all wp methods
This is a great suggestion. I would also like to be able to offer WordPress-generated thumbnails to my users.