gpt4 book ai didi

css - 图片横着显示

转载 作者:行者123 更新时间:2023-11-28 07:56:33 25 4
gpt4 key购买 nike

我正在使用 CarrierWave 上传图片。图片上传正常。但是任何垂直图像(仅垂直图像)都会横向显示。我该如何解决这个问题?

    <div class="row">
<div class="profile_picture">
<%= image_tag @user.attachment.url %>
</div>
</div>

图片标签变成:

<img src="/uploads/user/attachment/23/CIMG6610.JPG" alt="Cimg6610">

CSS:

.profile_picture {
max-width: 100%;
img {
max-width: 100%;
}
}

如果我直接在浏览器“localhost:3000/uploads/user/attachment/23/CIMG6610.JPG”中查看上传,它会正确显示

最佳答案

好像是上传的问题。将此添加到我的 uploader 解决了这个问题。

  process :auto_orient

def auto_orient
manipulate! do |img|
img = img.auto_orient
end
end

感谢@JohnDevelops

关于css - 图片横着显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30078003/

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