TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: PlaceGuitar - my weekend image placeholder project

5 点作者 poissonpie将近 14 年前
http://www.placeguitar.com<p>My weekend project is, as you may have guessed, an image placeholder service that serves up guitars! The inspiration came from a tweet (http://twitter.com/#!/zedshaw/status/88126558686019584 ). I decided to hack it together using Python on Google App Engine. The service is simple - pass in your width and height in the url (e.g. www.placeguitar.com/800/600 to get an 800 by 600 image) and get back a random image of a guitar to your size spec. Pop the url in the src of your img tag to use it on a site. That's all it does. There is a quick and dirty admin only form to upload images.<p>The only real challenge was deciding how to scale images. GAE doesn't let you ignore aspect ratio when you resize images which was my original plan for a quick prototype - obviously this wouldn't be very elegant because images would have been distorted for anything that didn't respect the original image's aspect ratio. I settled on scaling to the best approximation and then cropping to centre.<p>The code is on github (https://github.com/poissonpie/Place-Guitar) if anyone is interested. I only tinker in Python now and then so I don't expect it to be all that elegant.<p>I would love any feedback on any aspect of the project.<p>Thanks for looking.

1 comment

revorad将近 14 年前
Very neat idea and nicely done. Small bug - <a href="http://www.placeguitar.com/800/600" rel="nofollow">http://www.placeguitar.com/800/600</a> works but <a href="http://placeguitar.com/800/600" rel="nofollow">http://placeguitar.com/800/600</a> just redirects to the site.
评论 #2777083 未加载