简体   繁体   English

进阶相片上载程式外挂程式-可以做到这一点的任何建议

[英]Advanced photo uploader plugin - any suggestions for one that can do this

I have an app where I want users to be able to upload a photo for their profile. 我有一个应用程序,希望用户可以上传个人资料照片。 The photo will be quite big on their profile page - 640x360px which translates to 16:9 ratio which seems to be the standard image size from a digital camera. 这张照片在他们的个人资料页面上会非常大-640x360px,相当于16:9的比例,这似乎是数码相机的标准图像尺寸。

I haven't done this before (bit of a noob) and there's a couple of things I don't know whats the best way to handle. 我以前没有做过(有点菜鸟),而且有几件事我不知道最好的处理方法是什么。

So I want an 'upload image' button which causes a popup which allows the user to resize or crop the image they're uploading so if fits nicely into a 640x360px div. 因此,我需要一个“上传图片”按钮,该按钮会引起一个弹出窗口,允许用户调整其大小或裁剪正在上传的图像,以便使其适合640x360px的div。 But if the image they're uploading is, for example, 16:16 ratio and 5000px wide, then obviously it needs to be resized before being shown to the user where he can then crop the image to fit into my required 16:9 ratio. 但是,如果他们要上传的图像的比例为16:16,而宽度为5000px,则显然需要调整大小,然后再向用户展示,然后用户可以裁剪图像以适合我所需的16:9比例。

Equally if the image the user wants to use it tiny I want to encourage them to scale their picture up so if fits nicely into the div I want it in. 同样,如果用户希望使用很小的图像,我希望鼓励他们放大图片,以便使其很好地适合div。

I guess this is a common problem and I'm hoping there's a plugin but after sifting for an hour or so through the endless plugins on jQuery's plugin website I couldn't spot one which actually does the above. 我猜这是一个普遍的问题,我希望有一个插件,但是在jQuery插件网站上无休止的插件中筛选了一个小时左右后,我找不到一个能真正完成上述任务的插件。

I'm looking for some recommendations from some smart people :) 我正在寻找一些聪明人的建议:)

thanks 谢谢

Its not really a common problem, and file upload is actually fairly difficult. 这并不是一个普遍的问题,文件上传实际上相当困难。 The problem is that you are very restricted because of security concerns. 问题是您出于安全考虑而受到严格限制。

What you could do is just do a normal file upload (there are plenty of tutorials online if you need help with that), and then use ImageMagick to resize the images to the resolution you want serverside. 您可以做的只是上传普通文件(如果需要帮助,可以在线上提供大量教程),然后使用ImageMagick将图像调整为所需的服务器端分辨率。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM