WordPress 插件开发上传图片
我目前正在开发一个 WordPress 图像滑块插件。然而我已经碰壁了..
我希望能够允许使用该插件的人上传图像,然后像媒体一样处理我的functions.php文件中设置的大小 - >添加新的上传器
会这样做一次只有一张图像,所以我不需要上传器是 flash..但我确实需要它来执行 wordpress 自动执行的处理...
或者,如果有一种方法可以让用户将图像裁剪为任何尺寸会更好..即..有点像Facebook上的个人资料图片选择工具..
如果有人能指出我正确的方向,我将非常感激..
提前感谢
haxxxton
i am currently developing a wordpress image slider plugin. However i have hit a wall..
I want to be able to allow people who are using the plugin to upload images and have then crunch to the sizes set in my functions.php file just like the media->add new uploader does
It would only be one image at a time so i dont need the uploader to be flash.. but i do need it to perform the crunching that wordpress does automatically...
alternatively if there is a way that the user could crop the image to any dimension that would be better.. ie.. kind of like the profile picture selection tool on facebook..
if anyone can point me in the right direction i would really appreciate it..
thank you in advance
haxxxton
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
欢迎来到SO!
我建议您上传并保留原始图像,然后在使用某种形式的缩略图脚本显示图像时根据需要调整大小/裁剪,而不是在上传时将图像保存为各种尺寸。
我想到了蒂姆拇指。易于设置和使用:http://code.google.com/p/timthumb/
Welcome to SO!
Instead of saving the image to various sizes on upload, I'd recommend you upload and keep the original and simply resize/crop to your needs when you display it by using some form of thumbnail script.
Tim thumb comes to mind. Easy to setup and use : http://code.google.com/p/timthumb/