8 ms·
A 'lorem ipsum' for images.
- steerpike 17y agoThis is pretty awesome for front-end developers. Nice work.
- kingkool68 17y agoBy a front end developer, for front end developers. Let me know how I might make it better. Planned additions include True file format support (add .jpg and you get a real jpg etc) Right now you can add an extension but it still serves up a gif. Easier syntax for making squares (/250 would work instead of typing /250x250) Ability to change the background color
- njharman 17y agohttp://dummyimage.com/1x8000000 http://dummyimage.com/1x8000000 Fatal error: Allowed memory size of 94371840 bytes exhausted (tried to allocate 64000000 bytes) in /home/kingkool68/dummyimage.com/code.php on line 18 Opps... Sorry. Curiously http://dummyimage.com/8000000x1 http://dummyimage.com/8000000x1 works And should have option to set RGB of image.
- kingkool68 17y agoThank you for exploring the bounds of my shared-server memory limits.
- njharman 17y agoThat wasn't really my intention, (why the oops). I was trying to see how massive a a scroll bar I could make (sadly firefox does not scroll images (hmmmm, or maybe it was autoresizing it to fit on available screen). Also, being a programmer and very much into testing I naturally think of pushing bounds.
- kingkool68 17y agoDon't worry you didn't break anything. Firefox will show scrollbars if you click on the image which will show it at actual size.
- jbyers 17y agoThe code checks to see that x is nine or fewer characters, so you can try to request up to 9999999x9 or 9x9999999.
- charlesmarshall 17y agoyou can trigger it with http://dummyimage.com/9000x9500 http://dummyimage.com/9000x9500 as well
- kingkool68 17y agoOh yea I'm working on an option to change the background color. I was hoping to use an elegant syntax like http://dummyimage.com/300x250#ccc http://dummyimage.com/300x250#ccc for a gray background. Too bad you can't capture anything after the hash tag on the server side. Any feedback on a better syntax?
- mshafrir 17y agohttp://dummyimage.com/300x250/ccc http://dummyimage.com/300x250/ccc
- rbranson 17y agoAuthor might not want to distribute arial.ttf for reasons of copyright violation.
- kingkool68 17y agoWhat can I say, I live on the edge.
- CamperBob 17y agoHe isn't distributing the font, is he? Rendered representations of fonts are explicitly permitted by US copyright law under all circumstances as far as I'm aware.
- ori_b 17y agoLenna is the lorem ipsum for images (http://upload.wikimedia.org/wikipedia/en/2/24/Lenna.png http://upload.wikimedia.org/wikipedia/en/2/24/Lenna.png). For a bit of history, http://en.wikipedia.org/wiki/Lenna http://en.wikipedia.org/wiki/Lenna
- akamaka 17y agoNot really, Lenna is more like the Utah teapot of images.
- imperator 17y agohttp://en.wikipedia.org/wiki/Utah_teapot http://en.wikipedia.org/wiki/Utah_teapot
- pg 17y agoWe had one in our demo store for Viaweb, a version of which still seems to exist, probably unbeknown to Yahoo: http://store.yahoo.com/acme/teapot.html http://store.yahoo.com/acme/teapot.html
- rickmode 17y agoAre they still running your code? I'd curious to know more of the history of Viaweb between 1999 and now. Is the architecture still the same (CLisp backed by files)? I'm curious from a "how good is Lisp long term" angle.
- pg 17y agoThe code later got translated into C++. However, we had a template language for describing pages that was basically Common Lisp with a few macros. These templates are stored on disk as s-expressions. They couldn't change the template language because some users had created their own. So the C++ version literally had to read Lisp programs off disk and execute them. I.e. it was a Lisp interpreter. That's what I was talking about at the time when I described it somewhere as a new world record for Greenspun's tenth rule. http://en.wikipedia.org/wiki/Greenspun%27s_Tenth_Rule http://en.wikipedia.org/wiki/Greenspun%27s_Tenth_Rule
- tlrobinson 17y agoI was hoping for Lenna.
- est 17y agohttp://dummyimage.com/640x-481 http://dummyimage.com/640x-481 http://dummyimage.com/640x-1e37 http://dummyimage.com/640x-1e37 Warning: imagecreate() [function.imagecreate]: Invalid image dimensions in /home/kingkool68/dummyimage.com/code.php
- thenduks 17y agoProbably because those are invalid image dimensions?
- pizza 17y agoDoesn't handle negative parameters. Otherwise, it looks pretty cool
- thechangelog 17y agoFor what possible purpose?
- oconnore 17y agoSo that people on Hacker News can't find a flaw with your program.
- mahmud 17y agoI just implemented a 3-layered payment processing system with infinite logging, and a double-ledger accounting system. Perfect. However, during testing, my colleague found that typing a negative number and clicking "Add Funds" deducted money from the user's balance and put a fund-transfer ticket out (unauthorized withdrawal!) And when the balance reached zero, no visible feedback or error was giving, but still the electronic fund transfer was initiated (free money!!) That taught me to process my financial side-effects with explicit, visible, calls; the generic dispatch, and abusing behind the scene meta-object features will make you broke.
- nfnaaron 17y agoShouldn't the example 640 x 480 image instead be labeled DCXL x CDLXXX?
- jfornear 17y agoPretty cool. I usually just use: http://jessefornear.com/images/mr-t.jpg http://jessefornear.com/images/mr-t.jpg (Dimensions be damned!)
- blhack 17y agoI'm pretty partial to this one: http://newslily.com/default.jpg http://newslily.com/default.jpg (It's called default because it used to be the placeholder photo on my website for people who hadn't uploaded a profile pic. I don't know who originally took it, or how to ask them for permission to use it, so I replaced it with something else. I keep it around because it's really funny though)
- scott_s 17y agoI think both don't work. The point of a placeholder pic is to have something tangible there while looking at a layout. If the picture is more interesting than the layout, then people will focus on the picture. That's the motivation behind "lorem ipsum": it superficially looks like English, but it's gibberish and people won't focus on it instead of the layout.
- kingkool68 17y agohttp://clientsfromhell.tumblr.com/post/253757614/i-sent-out-a-link-to-the-beta-of-a-site-i-was http://clientsfromhell.tumblr.com/post/253757614/i-sent-out-...
- mapleoin 17y agoI have a _programmer_ friend that acts like that customer...
- kingkool68 17y agoI feel sorry for you mapleoin
- hedgehog 17y agoVery cool. Suggestion: If you make the background pattern of the image a 1px checkerboard (light gray on dark gray or something else not too obnoxious) then that will make it easier to spot places where an image is being rescaled in-browser. A 1px border might be useful too...
- kingkool68 17y agoGood idea! I'm working on making an option to change the background color. Ideal syntax would be http://dummyimage.com/300x200#ccc http://dummyimage.com/300x200#ccc for a gray background. Too bad the server is never sent anchor information so I've got to find a better way.
- ThinkWriteMute 17y agoHmm, I might do this with a ruby script, except pull random images from WikiCommons with the exact size specified. (And color!)
- listic 17y agoThat would be really nice. Please do.
- logicalmind 17y agoYou might want to make sure they're safe for work. I would hate to pull a random image into my demo that was not appropriate...
- markkoberlein 17y agoThat's an interesting solution but couldn't you just resize a 1px grey GIF with the width and height attributes to act as a placeholder? You could also add the dimensions to an ALT and TITLE attributes so they are displayed when you mouse over it.
- gokhan 17y agoAnd you can always include jQuery with the overlay plugin to enhance the mouse over experience. Meanwhile, you can try to render 640x480 text in custom fonts via canvas... etc. I believe that dummyimage thing is dead simple.
- kingkool68 17y agoTry doing that with a print designer over your shoulder debating on two image sizes.
- markkoberlein 17y agoThat's a good point.
- fool 17y ago"Too big of an image!" just bugs me stylistically. Maybe: "The dimensions input are too large!"
- kingkool68 17y agoHow about "Could not compute"
- charliepark 17y agoI think giving a brief explanation is useful. Maybe "Sorry! We can't generate images that large!" or something. That explains what's going on without going too deep on the max dimensions and whatnot.
- derefr 17y ago"Our program can't withstand images of that magnitude!"
- c23gooey 17y agoComputer says no
- Jim_Neath 17y agoI tend to use this image (NSFW): http://files.myopera.com/coxy/albums/106123/trex-boner.jpg http://files.myopera.com/coxy/albums/106123/trex-boner.jpg
- x1a4 17y agoI whipped up a Ruby/Sinatra version of this. http://github.com/xxx/fakeimage http://github.com/xxx/fakeimage
- thenduks 17y agoGet it up on heroku!
- x1a4 17y agodone. http://fakeimage.heroku.com/ http://fakeimage.heroku.com/
- willcodeforfoo 17y agoI love the simplicity of this, a good reminder why Ruby is so awesome.
- knuckle_cake 17y agothanks! I've now gemified it for use in Rails apps without having to hit a separate site. It emits data URIs at the moment only, so no IE love yet. I had immediate need for it. http://github.com/xxx/placeholder_image http://github.com/xxx/placeholder_image
- pmichaud 17y agoThe next step is to generate these images as advertisements targeted at web developers.
- jwarzech 17y agoWhile an interesting idea I know I wouldn't use it if it was an ad. Despite the problem of my sample images trying to sell to me it would be annoying when trying to mockup a design (with images that randomly have undesired colors, patterns, etc.)
- pmichaud 17y agoIt's a solvable problem, and with the right targeting could actually be useful. How many people would discover Basalmiq for the first time via the placeholder image on their WIP site?
- kingkool68 17y agoI thought about this then I remembered I have a soul and like to better the world.
- tezza 17y agoFor your safety sake I hope you're not forking a userspace imager like imagemagick. http://dummyimage.com/640x480+--gravity+Center+--text+%60cat+%2Fetc%2Fpasswd%60 might not be too fun.
- deleted 17y ago[deleted]
- kingkool68 17y agoNope. Turns out I'm using GD's imageCreate function -> http://php.net/manual/en/function.imagecreate.php http://php.net/manual/en/function.imagecreate.php
- tezza 17y agoCool[1]... nice single purpose app BTW. My normal advice to you nifty niche App'ers is to look at long standing apps to see what they did right for revenue. Namely http://www.network-science.de/ascii/ http://www.network-science.de/ascii/ ---------------- [1] GD still has its own problems, but it seems like subscribing to secunia for GD would catch most, like this recent one :: http://secunia.com/advisories/38055/ http://secunia.com/advisories/38055/
- ori_b 17y agoIt's perfectly safe to do that; exec() doesn't reinterpret the arguments through the shell, but passes them verbatim to the program. Just make sure you don't use 'system()' (or the equivalent call in whatever your language is) to launch things. It was a bad idea from the start.
- joeld42 17y agoThanks! Some features that would make this really useful: - custom colors (as mentioned by others) - an X across the image, corner to corner - Optional text instead of the size (i.e. "lead photo", "thumb") - a tag (or the resolution) repeated in an offset "brick" pattern across the entire image, similar color to BG The last one probably overkill but useful for when you are doing something like scrolling window, where not all of the image is displayed.
- willcodeforfoo 17y agoHow about allowing named arguments for common sizes, like IAB (http://www.iab.net/iab_products_and_industry_services/1421/1443/1452 http://www.iab.net/iab_products_and_industry_services/1421/1...) or common display sizes (http://en.wikipedia.org/wiki/File:Vector_Video_Standards2.svg http://en.wikipedia.org/wiki/File:Vector_Video_Standards2.sv...)? So you could do, http://dummyimage.com/skyscraper http://dummyimage.com/skyscraper instead of http://dummyimage.com/120x600 http://dummyimage.com/120x600
- kingkool68 17y agoHmmm it's a thought.
- prewett 17y agoI'm a bit confused. It doesn't seem like this is very "lorem ipsum". Lorem ipsum looks like actual text, whereas, this does not look like actual image content (due to most images not being solid gray). To my mind, a better lorem ipsum image would have a variety of colors, shading, textures (which is probably why Lenna is a popular choice). This way you could see how a variety of image colors work with your design, color scheme, etc. If this is simply for formatting placeholders while designing web pages, wouldn't <span style="width: xxx; height: yyy; background-color: grey; border: 1px solid black;"></span> be a pretty easy workaround, and a lot easier on the network bandwidth?
- kingkool68 17y agoSee here -> http://news.ycombinator.com/item?id=1077158 http://news.ycombinator.com/item?id=1077158
- prewett 17y agoI'm not sure I follow your response correctly, but it seems like your response is: it's easy to switch image sizes this way. But you still have to edit the HTML, and it's not that hard to edit the width/height. Maybe I don't understand? The more important point to my mind is that grey is definitely not lorem-ipsum. It doesn't help me evaluate anything except image size. And since it's easy to get a sized placeholder, a server to generate a URL seems not that helpful.
- pavel_lishin 17y agohttp://dummyimage.com/64xbanana http://dummyimage.com/64xbanana
- rbanffy 17y agoI would like if he clarified the license.