Author Topic: Show pic's by width 450 without resize the original  (Read 3980 times)

0 Members and 1 Guest are viewing this topic.

Offline KatzenAG

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • KatzenAG-das grosse Katzenportal im Internet
Show pic's by width 450 without resize the original
« on: September 05, 2009, 08:34:46 PM »
Hello,

my webhoster (1&1) allows no more activity than 10 sec.   Due this I resize the pictures myself with Adobe by downloading. 
It's ok for me.   But what I want is that the pic's allways shown by width at 450 pix. 

For example in the control panel, whan I edit pic's the pic is shown allways smaller then the original.   I thing this is to avoid to spread the layout. 

And this is what I want.   The pic's  should shown by a width at 450 pix allways, independent from the original size.   
Ok, time to time I will edit the pic's to save memory but this is ok. 

I Ihink something in details.  html should be changed?

Thanks a ton

Best regards
Hakan
  


It's ok, the solution is

<!-- Template file for JPG Files -->
<!-- <img src="{media_src}" border="1" alt="{image_name}"{width_height} /><br /> -->

<script language="javascript">
var saveWidth = 0;

function scaleImg(what){
what = document. getElementById(what);
 if (navigator. appName=="Netscape")
  winW = window. innerWidth;
 if (navigator. appName. indexOf("Microsoft")!=-1)
  winW = document. body. offsetWidth;
 if (what. width>(450) || saveWidth>(450)) {
  if (what. width==(450))
   what. width=saveWidth;

else
 {
 saveWidth = what. width;
  what. width=(450);
 }

}
}
</script>
<img id="picture"  onLoad="scaleImg('picture')" SRC="{media_src}" alt="{image_name}">


in default/media
« Last Edit: September 06, 2009, 01:38:15 AM by KatzenAG »

Offline nl2dav

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: Show pic's by width 450 without resize the original
« Reply #1 on: September 12, 2009, 02:00:21 AM »
Web browser based resizing always degrades image quality badly.