Pelican Parts
Parts Catalog Accessories Catalog How To Articles Tech Forums
Call Pelican Parts at 888-280-7799
Shopping Cart Cart | Project List | Order Status | Help



Go Back   Pelican Parts Forums > Miscellaneous and Off Topic Forums > Off Topic Discussions


Reply
 
LinkBack Thread Tools Rate Thread
Author
Thread Post New Thread    Reply
Registered
 
pmajka's Avatar
 
Join Date: Dec 2005
Posts: 1,284
Question pictures and HTML and UN*X and Questions.

So , i am a snappy kind of guy who likes to snap some pictures once in a while...

anyone have an app or script to take the contents of a directory (pictures in JPG format) and churn out a simple HTML file?

__________________
Have you ever felt suffocated while watching the Oxygen Channel?
People with excuses fail. As soon as I OK my actions with an excuse, I cease bettering myself.
88 Carrera
Old 05-22-2006, 11:19 AM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #1 (permalink)
Too big to fail
 
widebody911's Avatar
 
Join Date: Jan 2002
Location: Carmichael, CA
Posts: 33,894
Garage
Send a message via AIM to widebody911 Send a message via Yahoo to widebody911
Yeah, I have one that uses ImageMagick to create the thumbnails.
__________________
"You go to the track with the Porsche you have, not the Porsche you wish you had."
'03 E46 M3
'57 356A
Various VWs
Old 05-22-2006, 11:52 AM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #2 (permalink)
Registered
 
id10t's Avatar
 
Join Date: Mar 2003
Posts: 10,346
Code:
#!/bin/bash
for i in `ls -1 *jpg`
do
  echo \< img src=\"$i\"\>  >> htmlfile.htm
done
You could even pass it an arg, so you control what HTML file gets created

Code:
#!/bin/bash

for i in `ls -1 *jpg`
do
  echo \< img src=\"$i\"\>  >>$1
done
__________________
“IN MY EXPERIENCE, SUSAN, WITHIN THEIR HEADS TOO MANY HUMANS SPEND A LOT OF TIME IN THE MIDDLE OF WARS THAT HAPPENED CENTURIES AGO.”
Old 05-22-2006, 11:52 AM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #3 (permalink)
Too big to fail
 
widebody911's Avatar
 
Join Date: Jan 2002
Location: Carmichael, CA
Posts: 33,894
Garage
Send a message via AIM to widebody911 Send a message via Yahoo to widebody911
(pasting isn't working because of the BB HTML translations.)

Basically loop thru the *.jpg files, and just use echo/print to create a hyperlink. For a nice touch, you can add header info, meta tags, etc.
__________________
"You go to the track with the Porsche you have, not the Porsche you wish you had."
'03 E46 M3
'57 356A
Various VWs
Old 05-22-2006, 11:57 AM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #4 (permalink)
Too big to fail
 
widebody911's Avatar
 
Join Date: Jan 2002
Location: Carmichael, CA
Posts: 33,894
Garage
Send a message via AIM to widebody911 Send a message via Yahoo to widebody911
Let the shell glob it for you:

Code:
for i in *.jpg
__________________
"You go to the track with the Porsche you have, not the Porsche you wish you had."
'03 E46 M3
'57 356A
Various VWs
Old 05-22-2006, 11:59 AM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #5 (permalink)
Registered
 
id10t's Avatar
 
Join Date: Mar 2003
Posts: 10,346
widebody911 - put your code between brackets with "code" and "/code" as the contents like HTML tags, but with [ and ] instead of < and >
__________________
“IN MY EXPERIENCE, SUSAN, WITHIN THEIR HEADS TOO MANY HUMANS SPEND A LOT OF TIME IN THE MIDDLE OF WARS THAT HAPPENED CENTURIES AGO.”
Old 05-22-2006, 12:01 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #6 (permalink)
 
Too big to fail
 
widebody911's Avatar
 
Join Date: Jan 2002
Location: Carmichael, CA
Posts: 33,894
Garage
Send a message via AIM to widebody911 Send a message via Yahoo to widebody911
I lost some of the formatting, but this shoudl work

I denote thumbnails with an '_' as the leading character of the file name, which is why I glob the list of file names as I do; I could have made cleaner with sed, but oh well...

Code:
#!/bin/sh

INDEX="index.html"
if [ ! -f "index.html" ]
then
	cat >> $INDEX << EOF
<html>
<head>
<link rel=stylesheet href='http://www.yourdomain.com/style.css' TYPE='text/css'>
<!--
Thom Fitzpatrick
-->
<meta name='description' content='Thom Fitzpatrick'> <title></title> </head> <body> <h4></h4> <p>

EOF
fi

for each in [a-zA-Z0-9]*.jpg [a-zA-Z0-9]*.JPG [a-zA-Z0-9]*.gif [a-zA-Z0-9]*.GIF [a-zA-Z0-9]*.TIF [a-zA-Z0-9]*.TIFF [a-zA-Z0-9]*.tif [a-zA-Z0-9]*.tiff [a-zA-Z0-9]*.png [a-zA-Z0-9]*.PNG do
	[ -f "$each" ] || continue
	[ ! -f "_$each" ] && convert -geometry 100 -quality 50 $each _$each 
	grep -qw "$each" $INDEX
	if [ $? -ne 0 ]
	then
		cat >> $INDEX << EOF
<br clear=left>
<hr size=1><p>
<a href=$each><img src=_$each></a> <br clear=left>

EOF
	fi
done
__________________
"You go to the track with the Porsche you have, not the Porsche you wish you had."
'03 E46 M3
'57 356A
Various VWs
Old 05-22-2006, 12:25 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #7 (permalink)
Registered
 
pmajka's Avatar
 
Join Date: Dec 2005
Posts: 1,284
Ah HA...Caught ya....THE GEEKS...THEY ARE HERE!!!!!..

seriously...thanks guys....this is exactly what i need.
__________________
Have you ever felt suffocated while watching the Oxygen Channel?
People with excuses fail. As soon as I OK my actions with an excuse, I cease bettering myself.
88 Carrera
Old 05-22-2006, 03:22 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #8 (permalink)
Registered
 
pmajka's Avatar
 
Join Date: Dec 2005
Posts: 1,284
Too much time washing ans waxing this thing...

__________________
Have you ever felt suffocated while watching the Oxygen Channel?
People with excuses fail. As soon as I OK my actions with an excuse, I cease bettering myself.
88 Carrera
Old 05-22-2006, 03:36 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #9 (permalink)
Registered
 
david.avery's Avatar
 
Join Date: Nov 2000
Location: CT
Posts: 1,115
Garage
There's a few freeware scripts out there that not only do this, they thumbnail and nicely format the HTML, with css support etc. Hit google and you'll see em. In the end, it's not hard, its about who spent the longest time and started from the nicest HTML template.

__________________
David Avery
05 Lotus Elise (sold) | 08 BMW 135i
visit FocusedE, my e-business company | visit Spyderclub
Old 05-22-2006, 03:41 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #10 (permalink)
Reply


 


All times are GMT -8. The time now is 09:07 AM.


 
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0
Copyright 2025 Pelican Parts, LLC - Posts may be archived for display on the Pelican Parts Website -    DMCA Registered Agent Contact Page
 

DTO Garage Plus vBulletin Plugins by Drive Thru Online, Inc.