gpt4 book ai didi

jquery - Rails3 Paperclip JCrop 进入循环

转载 作者:数据小太阳 更新时间:2023-10-29 07:53:36 25 4
gpt4 key购买 nike

我有这个配置的典型设置,没什么特别的,就像本教程中的一样:http://shareyourtechskills.blogspot.com/2011/01/jcrop-with-paper-clip-plugin.html

上传头像 - 工作正常,但当我裁剪它时,进程卡在循环中,并在控制台中出现以下错误:

convert: GeometryDoesNotContainImage `/var/folders/4p/v_37jqkj6810y7wsd8b7ly100000gn/T/38361898520121013-26133-1cbz90w20121013-26133-1x1vcii20121013-26133-gjlod.png' @ warning/transform.c/CropImage/572.
convert: GeometryDoesNotContainImage `/var/folders/4p/v_37jqkj6810y7wsd8b7ly100000gn/T/38361898520121013-26133-fwu1jt.jpg' @ warning/transform.c/CropImage/572.
convert: GeometryDoesNotContainImage `/var/folders/4p/v_37jqkj6810y7wsd8b7ly100000gn/T/38361898520121013-26133-fwu1jt20121013-26133-1p255t220121013-26133-i8ny07.png' @ warning/transform.c/CropImage/572.
convert: GeometryDoesNotContainImage `/var/folders/4p/v_37jqkj6810y7wsd8b7ly100000gn/T/38361898520121013-26133-18wr3op.jpg' @ warning/transform.c/CropImage/572.
convert: GeometryDoesNotContainImage `/var/folders/4p/v_37jqkj6810y7wsd8b7ly100000gn/T/38361898520121013-26133-18wr3op20121013-26133-kp6o120121013-26133-1ut9jfy.png' @ warning/transform.c/CropImage/572.
convert: GeometryDoesNotContainImage `/var/folders/4p/v_37jqkj6810y7wsd8b7ly100000gn/T/38361898520121013-26133-1hjxk9x.jpg' @ warning/transform.c/CropImage/572.
convert: GeometryDoesNotContainImage `/var/folders/4p/v_37jqkj6810y7wsd8b7ly100000gn/T/38361898520121013-26133-1hjxk9x20121013-26133-rjrf8c20121013-26133-1eyrpxv.png' @ warning/transform.c/CropImage/572.
convert: GeometryDoesNotContainImage `/var/folders/4p/v_37jqkj6810y7wsd8b7ly100000gn/T/38361898520121013-26133-6h4lu.jpg' @ warning/transform.c/CropImage/572.

这个字符串大约有 500 个,然后我得到这个:

Started PUT "/users/1" for 127.0.0.1 at 2012-10-13 00:34:24 +0300
Processing by UsersController#update as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"ht7YiTS5yOqXFy0EWeFVLBfv5eZU0codQfR8DvlKHA=", "user"=>{"crop_x"=>"223", "crop_y"=>"113", "crop_w"=>"145", "crop_h"=>"145"}, "commit"=>"Сохранить", "id"=>"1"}
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", "1"]]
CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1
(0.0ms) begin transaction
User Exists (0.1ms) SELECT 1 FROM "users" WHERE (LOWER("users"."email") = LOWER('example@example.com') AND "users"."id" != 1) LIMIT 1
Command :: identify -format %wx%h '/var/folders/4p/v_37jqkj6810y7wsd8b7ly100000gn/T/38361898520121013-26133-10hxtsn.jpg[0]'
Command :: convert '/var/folders/4p/v_37jqkj6810y7wsd8b7ly100000gn/T/38361898520121013-26133-10hxtsn.jpg[0]' -crop 145x145+223+113 -auto-orient -resize "145x" +repage '/var/folders/4p/v_37jqkj6810y7wsd8b7ly100000gn/T/38361898520121013-26133-10hxtsn20121013-26133-1hplq8v.png'
Command :: identify -format %wx%h '/var/folders/4p/v_37jqkj6810y7wsd8b7ly100000gn/T/38361898520121013-26133-10hxtsn20121013-26133-1hplq8v20121013-26133-m37pe.png[0]'
Command :: identify -format %m '/var/folders/4p/v_37jqkj6810y7wsd8b7ly100000gn/T/38361898520121013-26133-10hxtsn20121013-26133-1hplq8v20121013-26133-m37pe.png[0]'
Command :: identify -format %m '/var/folders/4p/v_37jqkj6810y7wsd8b7ly100000gn/T/38361898520121013-26133-10hxtsn20121013-26133-1hplq8v20121013-26133-m37pe.png[0]'
Command :: convert '/var/folders/4p/v_37jqkj6810y7wsd8b7ly100000gn/T/38361898520121013-26133-10hxtsn20121013-26133-1hplq8v20121013-26133-m37pe.png[0]' -crop 145x145+223+113 -auto-orient -resize "50x" +repage '/var/folders/4p/v_37jqkj6810y7wsd8b7ly100000gn/T/38361898520121013-26133-10hxtsn20121013-26133-1hplq8v20121013-26133-m37pe20121013-26133-nkvpon'
Command :: file -b --mime '/var/folders/4p/v_37jqkj6810y7wsd8b7ly100000gn/T/38361898520121013-26133-10hxtsn20121013-26133-1hplq8v20121013-26133-m37pe20121013-26133-nkvpon'
CACHE (0.0ms) SELECT 1 FROM "users" WHERE (LOWER("users"."email") = LOWER('inc@gnezdom.com') AND "users"."id" != 1) LIMIT 1
Command :: identify -format %wx%h '/var/folders/4p/v_37jqkj6810y7wsd8b7ly100000gn/T/38361898520121013-26133-1hut940.jpg[0]'
Command :: convert '/var/folders/4p/v_37jqkj6810y7wsd8b7ly100000gn/T/38361898520121013-26133-1hut940.jpg[0]' -crop 145x145+223+113 -auto-orient -resize "145x" +repage '/var/folders/4p/v_37jqkj6810y7wsd8b7ly100000gn/T/38361898520121013-26133-1hut94020121013-26133-1k0w0qh.png'
Command :: identify -format %wx%h '/var/folders/4p/v_37jqkj6810y7wsd8b7ly100000gn/T/38361898520121013-26133-1hut94020121013-26133-1k0w0qh20121013-26133-69pm09.png[0]'
Command :: identify -format %m '/var/folders/4p/v_37jqkj6810y7wsd8b7ly100000gn/T/38361898520121013-26133-1hut94020121013-26133-1k0w0qh20121013-26133-69pm09.png[0]'
Command :: identify -format %m '/var/folders/4p/v_37jqkj6810y7wsd8b7ly100000gn/T/38361898520121013-26133-1hut94020121013-26133-1k0w0qh20121013-26133-69pm09.png[0]'
Command :: convert '/var/folders/4p/v_37jqkj6810y7wsd8b7ly100000gn/T/38361898520121013-26133-1hut94020121013-26133-1k0w0qh20121013-26133-69pm09.png[0]' -crop 145x145+223+113 -auto-orient -resize "50x" +repage '/var/folders/4p/v_37jqkj6810y7wsd8b7ly100000gn/T/38361898520121013-26133-1hut94020121013-26133-1k0w0qh20121013-26133-69pm0920121013-26133-2rw91z'
Command :: file -b --mime '/var/folders/4p/v_37jqkj6810y7wsd8b7ly100000gn/T/38361898520121013-26133-1hut94020121013-26133-1k0w0qh20121013-26133-69pm0920121013-26133-2rw91z'

也是大约 500,然后我在浏览器中收到此错误:

SystemStackError in UsersController#update
stack level too deep

我很感兴趣,如果我只修剪一张,为什么会有这么多图片?谢谢

最佳答案

大多数文章已过时且与当前版本的回形针和 rails 不兼容,因此此配置需要重新组织,如评论中所述 http://railscasts.com/episodes/182-cropping-images?view=comments#comment_160006福纳说,那

    avatar.reprocess!

必须不是从模型而是从这样的 Controller 调用:

    @user.avatar.reprocess!

当然,您需要验证它是否存在裁剪变量,例如 crop_x 和其他附言感谢 Fona 的评论。

关于jquery - Rails3 Paperclip JCrop 进入循环,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12867661/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com