-
Notifications
You must be signed in to change notification settings - Fork 333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
裁剪图片为什么只是显示一小部分 #16
Comments
1、一开始没设置max_length=......,报错:Data truncated for column 'photo' at row 1") result = self._query(query), |
开发中遇到奇葩事情很正常。其实,主要是因为web开发涉及的面比较多,不一定哪里没有协调好,就出问题了。如果你愿意,更欢迎到QQ群里面去讨论。
yudukanghe <notifications@github.com> 于2019年5月28日周二 下午12:56写道:
… 1、一开始没设置max_length=......,报错:Data truncated for column 'photo' at row 1")
result = self._query(query),
2、猜想和varchar长度有关,开始设置max_length=255,仍然错误
3、猜想是mysql8编码问题,开始配置mysqld.cnf,仍然报错
4、看到上一楼主帖子设置了max_length=10000,遂设置max_length=150000,没报错但图片没显示完全...
5、估算了已经显示的头像部分和未显示的部分比例,遂设置max_length=300000,数据迁移的时候报错了,后来发现了varchar最大是65355
6、面对终端扑面而来的异常,是夜已经快凌晨了,心绪愈加急躁,开始删库,重新迁移数据,到处搜索
7、最后发现,无论如何,migrate的时候,总会有一个warning:....python3.6/site-packages/pymysql/cursors.py:170
(1246,"convertiong column 'photo' from VARCHAR to TEXT")
result=self._query(query),重复数据迁移大约半个小时,仍然是这个东西
8、找了半天资料,都没用,最后觉得似乎可以接受这个warning,但是无关紧要为啥要warning呢
9、是夜不知几点了,只能洗澡睡觉了
10、今天本来不打算处理这个问题的,但是午饭后,想想在window环境下看看怎么样?结果还是一样,不过不删库了,知道和那没关系应该,索性再改max_length=60000,在迁移,出乎意料,图片能完全显示了!成功了!
——不知道为啥要设置这么长,然后还有那些让人觉得烦人的warning
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#16?email_source=notifications&email_token=AA32L2YLMDLXLPDJKYVKHF3PXS3RXA5CNFSM4HP5CFLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWK63GQ#issuecomment-496364954>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA32L2ZKQPWDFAWPHUZNR4DPXS3RXANCNFSM4HP5CFLA>
.
--
*QiWei*
|
$('#btnCrop').on('click', function(){
//alert("图片上传喽");
$.ajax({
url: '{% url "account:my_image" %}',
type: 'POST',
data: {"img": img},
success: function(e){
location.href= "{% url 'account:my_information' %}" },
photo=models.ImageField(max_length=15000,blank=True)
个人信息页面显示的图片只是剪裁图片页面所剪裁图片的的一小部分
The text was updated successfully, but these errors were encountered: