缩略图 - 将宽度减半但高度加倍? [英] Thumbnails - Halving width but doubling height?

查看:54
本文介绍了缩略图 - 将宽度减半但高度加倍?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我一直在寻找创建缩略图的教程,最后找到一个适合我的缩略图。除了一件事之外,它正在做所有的事情。


我创建了600px宽,700px高的测试图像,因此要获得300px宽度,它需要一半,以及700px的高度。它正在将宽度调整为一半大小(300px),除了将高度减半到350px,它将其加倍到1400px,这显然会导致图像出错。


这里是我正在使用的代码:

Hello, I''ve been searching for a tutorial to create thumbnails for a while and finally found one that works for me. It''s doing everything it''s suppose to except one thing.

I created a test image 600px wide, 700px high, so to get 300px width it would need to half that, as well as the 700px height. It''s resizing the width to half the size (300px) except instead of halfing the height to 350px, it doubles it to 1400px, which obviously causes the image to come out very wrong.

Here''s the code I''m using:

展开 | 选择 | Wrap | 行号

推荐答案

换行7

[php]

ratio =
change line 7
[php]
ratio =


thumbWidth /
thumbWidth /


origWidth ;

[/ php]


问候

jx2
origWidth ;
[/php]

regards
jx2


这篇关于缩略图 - 将宽度减半但高度加倍?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆