B4Print.com

Web Development & Design => Design Applications => Topic started by: Joe on September 02, 2010, 01:16:52 PM

Title: Dynamically resize image
Post by: Joe on September 02, 2010, 01:16:52 PM
I've inherited this code from a previous developer:

<img src="http://www.somesite.com/header.jpg" alt="Lamp" width="85%" height="85%" />


The intent there is to have the image be at 85% of the size of the site and the image dynamically scales proportionately if the user resizes the window...all the way down to fit on the iPhone/iPad. It works in Firefox but freaking Safari butchers it to death. I need to to work in all browsers. Anyone know how to accomplish this either via html or CSS?
Title: Re: Dynamically resize image
Post by: Syphon on September 02, 2010, 06:27:33 PM
Afraid of coding and not touching this.  <Backing out of this thread.>
Title: Re: Dynamically resize image
Post by: gnubler on September 02, 2010, 06:49:50 PM
Sorry, Joe. I'm backing out, too. Go ask the nerds at webdevforums (http://www.webdevforums.com/?), that's where I used to hang out.
Title: Re: Dynamically resize image
Post by: Joe on September 02, 2010, 06:53:08 PM
Quote from: gnubler on September 02, 2010, 06:49:50 PMSorry, Joe. I'm backing out, too. Go ask the nerds at webdevforums (http://www.webdevforums.com/?), that's where I used to hang out.

Shit, I was counting on you! :angry:
Title: Re: Dynamically resize image
Post by: Syphon on September 03, 2010, 05:35:59 AM
Well Joe, I believe you just found a way to clear a room. Or a thread in this case. :grin:
Title: Re: Dynamically resize image
Post by: gnubler on September 03, 2010, 07:01:56 AM
Cool, can we jack it now? I hate to see a fresh thread with so much potential just go to waste.
Title: Re: Dynamically resize image
Post by: Stiv on September 03, 2010, 07:37:43 AM
Quote from: gnubler on September 03, 2010, 07:01:56 AMCool, can we jack it now?

What you do in private is your own business.
Title: Re: Dynamically resize image
Post by: Joe on September 03, 2010, 09:55:58 AM
Well I figured out the answer in case anyone needs to know. Change

<img src="http://www.somesite.com/header.jpg" alt="Lamp" width="85%" height="85%" />

to

<img src="http://www.somesite.com/header.jpg" alt="Lamp" width="85%" />
Title: Re: Dynamically resize image
Post by: DigitalCrapShoveler on September 03, 2010, 10:16:27 AM
Quote from: Joe on September 03, 2010, 09:55:58 AMWell I figured out the answer in case anyone needs to know. Change

<img src="http://www.somesite.com/header.jpg" alt="Lamp" width="85%" height="85%" />
to

Quote<img src="http://www.somesite.com/header.jpg" alt="Lamp" width="85%" />

Whew! I'll sleep better.
Title: Re: Dynamically resize image
Post by: Joe on September 03, 2010, 10:32:44 AM
Quote from: DigitalCrapShoveler on September 03, 2010, 10:16:27 AM
Quote from: Joe on September 03, 2010, 09:55:58 AMWell I figured out the answer in case anyone needs to know. Change

<img src="http://www.somesite.com/header.jpg" alt="Lamp" width="85%" height="85%" />
to

Quote<img src="http://www.somesite.com/header.jpg" alt="Lamp" width="85%" />

Whew! I'll sleep better.

Which is why I posted the solution.
Title: Re: Dynamically resize image
Post by: DigitalCrapShoveler on September 03, 2010, 10:34:44 AM
Quote from: Joe on September 03, 2010, 10:32:44 AM
Quote from: DigitalCrapShoveler on September 03, 2010, 10:16:27 AM
Quote from: Joe on September 03, 2010, 09:55:58 AMWell I figured out the answer in case anyone needs to know. Change

<img src="http://www.somesite.com/header.jpg" alt="Lamp" width="85%" height="85%" />
to

Quote<img src="http://www.somesite.com/header.jpg" alt="Lamp" width="85%" />

Whew! I'll sleep better.

Which is why I posted the solution.

Goddamn, I'd admire you.
Title: Re: Dynamically resize image
Post by: gnubler on September 03, 2010, 10:46:40 AM
I "looked into it" a bit and noticed there are also techniques for sizing images with em units. I've never gotten into that.
Title: Re: Dynamically resize image
Post by: tapdn on September 03, 2010, 04:52:59 PM
backslash backslash semi-something something-or-the-other isn't it?
Title: Re: Dynamically resize image
Post by: Joe on September 03, 2010, 04:54:07 PM
Quote from: tapdn on September 03, 2010, 04:52:59 PMbackslash backslash semi-something something-or-the-other isn't it?

I thought that was the code for unlimited lives on The Legend of Zelda?
Title: Re: Dynamically resize image
Post by: Tracy on September 03, 2010, 05:55:01 PM
that's cool you figured it out, I took an html class awhile back, seems there's a lot more
ways to solve problems now.
I may have to check it out if I have any spare time someday :undecided:
Title: Re: Dynamically resize image
Post by: Joe on September 03, 2010, 07:06:21 PM
Quote from: Tracy on September 03, 2010, 05:55:01 PMthat's cool you figured it out, I took an html class awhile back, seems there's a lot more
ways to solve problems now.
I may have to check it out if I have any spare time someday :undecided:

I think HTML/CSS is less forgiving than printing. :sad:
Title: Re: Dynamically resize image
Post by: gnubler on September 03, 2010, 07:32:29 PM
Quote from: tapdn on September 03, 2010, 04:52:59 PMbackslash backslash semi-something something-or-the-other isn't it?

Yeah, and don't forget the dub-dub-dub and put quotes around EVERYTHING! And DON'T use CAPS, FFS! :cheesy:
Title: Re: Dynamically resize image
Post by: gnubler on September 03, 2010, 07:34:16 PM
Quote from: Joe on September 03, 2010, 07:06:21 PM
Quote from: Tracy on September 03, 2010, 05:55:01 PMthat's cool you figured it out, I took an html class awhile back, seems there's a lot more
ways to solve problems now.
I may have to check it out if I have any spare time someday :undecided:

I think HTML/CSS is less forgiving than printing. :sad:

Yes. One missing or wrong character and everything breaks. I have sent many jobs off to press that were missing an exclamation point here & there (because they're endangered) and the job still printed!
Title: Re: Dynamically resize image
Post by: tapdn on September 04, 2010, 09:40:03 AM
My first computer in 1985 didn't even have an OS. I couldn't even find my home folder. I hate coding as much as I hate cost accounting or shopping for insurance ffs
Title: Re: Dynamically resize image
Post by: gnubler on September 05, 2010, 12:58:03 AM
Now you can see why I went over the edge and am on the ledge...looks like Joe is now following the same painful path. Who knows what may happen. :scared:

In good news, today I received garbled news that I'm going to be relieved of my freelance webdev projects. This is a blessing. One step closer to dropping out!
Title: Re: Dynamically resize image
Post by: Joe on September 05, 2010, 09:04:47 AM
I like doing it. Unlike print, people actually do care what their web sites look like. And there is some intellectual challenge to it too. Not the drudgery of preflighting PDF's. If I could, I'd get out of print completely. Today. If not sooner.
Title: Re: Dynamically resize image
Post by: tapdn on September 05, 2010, 01:15:35 PM
Herding and babysitting PDFs is not my idea of prepress either Joe... at least not the prepress I fell in love with those years ago. The acceptable quality level today is crap!
Meanwhile back at the ranch all is well.
Title: Re: Dynamically resize image
Post by: Joe on September 05, 2010, 01:26:52 PM
That prepress is gone forever. :cry:
Title: Re: Dynamically resize image
Post by: Captain_Type on September 07, 2010, 06:55:18 AM
Quote from: Joe on September 02, 2010, 01:16:52 PMI've inherited this code from a previous developer:

<img src="http://www.somesite.com/header.jpg" alt="Lamp" width="85%" height="85%" />


The intent there is to have the image be at 85% of the size of the site and the image dynamically scales proportionately if the user resizes the window...all the way down to fit on the iPhone/iPad. It works in Firefox but freaking Safari butchers it to death. I need to to work in all browsers. Anyone know how to accomplish this either via html or CSS?

There is a new Safari patch. Maybe it was a bug and they fixed it.
Title: Re: Dynamically resize image
Post by: Captain_Type on September 07, 2010, 07:06:38 AM
It appears that only the Intel macs got a Safari upgrade to 5.0. The PowerPC's are still on 4.1.1, so probably no help, sorry.
Title: Re: Dynamically resize image
Post by: DigiCorn on September 07, 2010, 08:33:52 AM
I am on a Power PC Mac and my Safari is 5.0.1
Title: Re: Dynamically resize image
Post by: Joe on September 07, 2010, 09:46:38 AM
Quote from: Captain_Type on September 07, 2010, 06:55:18 AM
Quote from: Joe on September 02, 2010, 01:16:52 PMI've inherited this code from a previous developer:

<img src="http://www.somesite.com/header.jpg" alt="Lamp" width="85%" height="85%" />
The intent there is to have the image be at 85% of the size of the site and the image dynamically scales proportionately if the user resizes the window...all the way down to fit on the iPhone/iPad. It works in Firefox but freaking Safari butchers it to death. I need to to work in all browsers. Anyone know how to accomplish this either via html or CSS?

There is a new Safari patch. Maybe it was a bug and they fixed it.

Actually, Safari was doing exactly what it was told. It made it 85% of the width AND 85% of the height. Firefox knew that was wrong and read my mind for what I really wanted. It scaled the width by 85% and scaled the height proportionately. Removing the height tag and they both then scaled it the way I needed it. Like Firefox did it in the first place.
Title: Re: Dynamically resize image
Post by: gnubler on September 07, 2010, 10:05:42 AM
Thanks for the update. :tongue:
Title: Re: Dynamically resize image
Post by: Joe on September 07, 2010, 10:10:17 AM
Quote from: gnubler on September 07, 2010, 10:05:42 AMThanks for the update. :tongue:

Hopefully, like DCS, you will sleep better now.
Title: Re: Dynamically resize image
Post by: gnubler on September 07, 2010, 10:58:25 AM
Something's been *missing* from my life, but I now feel complete. You are a powerful man.
Title: Re: Dynamically resize image
Post by: Joe on September 07, 2010, 11:01:04 AM
Quote from: gnubler on September 07, 2010, 10:58:25 AMSomething's been *missing* from my life, but I now feel complete. You are a powerful man.

Getting deep in here. Where are my boots?
Title: Re: Dynamically resize image
Post by: gnubler on September 07, 2010, 11:21:19 AM
Probably under the couch cushions? That's why you can't find them.