472,965 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,965 software developers and data experts.

image clipping problem

hello,

I'm writing a panoramic image viewer in html / javascript. The idea is I
have a div with two identical panoramic photographs embedded in it. The
clipping on the div is set to make it a viewport onto the images. Then I
use javascript to make the two images scroll through the viewport - the
second image is just there to fill the gaps when the first scrolls off the
screen. They are seamless 360 degree panoramas, so this gives the illusion
of a seamless scroll around the whole scene.

You can see a test version of the page at:
http://lofty.dyndns.info/pano/pano-test.html

The html code is like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>Panorama-test</title>
<script type="text/javascript" src="js/dojo/dojo.js"></script>
<script type="text/javascript" src="js/pano.js"></script>
</head>
<body>
<h1 id="heading">Panorama Test
</h1>
<p id="message1">&nbsp;</p>
<p id="message2">&nbsp;</p>
<div style="position: relative; top: 0px; left: 0px;">
<div id="panoDiv"
style="position: absolute; top: 0px; left: 30px; width: 700px; height:
400px; clip: rect(0px, 700px, 400px, 0px);"><img
id="panoImage1"
style="position: absolute; width: auto; height: 400px; left: 0px;" alt=""
src="pano2.jpg"><img id="panoImage2" style="position: absolute; width:
auto; height: 400px; left: 0px;" alt="" src="pano2.jpg"></div>
</div>
<p>&nbsp;</p>
</body>
</html>

This is mostly working - the only problem I'm having is that the browser's
(Mozilla firefox) is setting the page width to be the width of the clipped
images, not the width of the div viewport. I.e. the horizontal
scrollbar appears even though the viewport is entirely within the
browser window. This is likely to cause me problems later on when I want
to embed the image viewer inside other page elements, so I'm trying to get
it fixed now.

does anyone have any idea how to fix this using html/css? (I'm already
clipping the images inside the javascript code, using img.style.clip="rect(....)")

--
http://www.niftybits.ukfsn.org/

remove 'n-u-l-l' to email me. html mail or attachments will go in the spam
bin unless notified with [html] or [attachment] in the subject line.

May 26 '06 #1
9 3359
Andy Baxter <ne***@earthsong.null.free-online.co.uk> wrote:
http://lofty.dyndns.info/pano/pano-test.html


Your concept is fatally flawed:

Size of main page:
1046 bytes
Number of inline elements:
1 ( 1)
Size of inline elements:
972103 bytes

Waaayyyy to much. Browsers also do a poor job at resizing images.

--
Spartanicus
May 26 '06 #2
Spartanicus said:
Andy Baxter <ne***@earthsong.null.free-online.co.uk> wrote:
http://lofty.dyndns.info/pano/pano-test.html
Your concept is fatally flawed:


How come it works fine on my system (mozilla firefox on linux)? (Apart
from the bug I've mentioned).
Size of main page:
1046 bytes
Number of inline elements:
1 ( 1)
Size of inline elements:
972103 bytes

Waaayyyy to much. Browsers also do a poor job at resizing images.


I'm going to build in an option to choose what resolution you want to view
the panorama at:

400 pixels high / 200 pixels high / 100 pixels high. This should take care
of any bandwidth issues (e.g. for modem users).

--
http://www.niftybits.ukfsn.org/

remove 'n-u-l-l' to email me. html mail or attachments will go in the spam
bin unless notified with [html] or [attachment] in the subject line.

May 26 '06 #3
Andy Baxter <ne***@earthsong.null.free-online.co.uk> wrote:
Size of main page:
1046 bytes
Number of inline elements:
1 ( 1)
Size of inline elements:
972103 bytes

Waaayyyy to much. Browsers also do a poor job at resizing images.


I'm going to build in an option to choose what resolution you want to view
the panorama at:

400 pixels high / 200 pixels high / 100 pixels high. This should take care
of any bandwidth issues (e.g. for modem users).


I doubt it, but feel free to try, come back when you've done that. Also
note that this belongs in c.i.w.a.stylesheets

--
Spartanicus
May 26 '06 #4
Spartanicus said:
Andy Baxter <ne***@earthsong.null.free-online.co.uk> wrote:
Size of main page:
1046 bytes
Number of inline elements:
1 ( 1)
Size of inline elements:
972103 bytes

Waaayyyy to much. Browsers also do a poor job at resizing images.


I'm going to build in an option to choose what resolution you want to view
the panorama at:

400 pixels high / 200 pixels high / 100 pixels high. This should take care
of any bandwidth issues (e.g. for modem users).


I doubt it, but feel free to try, come back when you've done that. Also
note that this belongs in c.i.w.a.stylesheets


How is doing that going to solve the image clipping problem I'm looking
for help on???

I'm planning to do it, but later once I've got the basic thing working.

--
http://www.niftybits.ukfsn.org/

remove 'n-u-l-l' to email me. html mail or attachments will go in the spam
bin unless notified with [html] or [attachment] in the subject line.

May 26 '06 #5
Andy Baxter <ne***@earthsong.null.free-online.co.uk> wrote:
I doubt it, but feel free to try, come back when you've done that. Also
note that this belongs in c.i.w.a.stylesheets


How is doing that going to solve the image clipping problem I'm looking
for help on???


This isn't a help desk. I for one am not willing to spend time on what
looks like a fatally flawed concept.

--
Spartanicus
May 26 '06 #6
Spartanicus said:
Andy Baxter <ne***@earthsong.null.free-online.co.uk> wrote:
I doubt it, but feel free to try, come back when you've done that. Also
note that this belongs in c.i.w.a.stylesheets


How is doing that going to solve the image clipping problem I'm looking
for help on???


This isn't a help desk. I for one am not willing to spend time on what
looks like a fatally flawed concept.


I still don't get why this concept is 'fatally flawed'. The only reason I
can see why images this large are a problem is because of the download
time, but even for the extra-large version I'm working with at the moment,
the download takes about 20-30 secs on a broadband connection, which is
acceptable to me. I accept that on a modem, this image would be too slow,
but then for that, I'm planning to give people a choice of using lower
resolution images. E.g.

100 pixels high gives an 11K file, which would be fine on a 56K modem
(about 3-4 seconds download)

170 pixels high gives a 31K file, which would still be OK over a modem.

400 pixels high at 50% quality gives a 182K file, which would be fine over
broadband.

I still don't see why there's really a problem with this.

--
http://www.niftybits.ukfsn.org/

remove 'n-u-l-l' to email me. html mail or attachments will go in the spam
bin unless notified with [html] or [attachment] in the subject line.

May 27 '06 #7
Crossposted and follow up set to
comp.infosystems.www.authoring.stylesheets

Andy Baxter <ne***@earthsong.null.free-online.co.uk> wrote:
I still don't get why this concept is 'fatally flawed'. The only reason I
can see why images this large are a problem is because of the download
time, but even for the extra-large version I'm working with at the moment,
the download takes about 20-30 secs on a broadband connection, which is
acceptable to me. I accept that on a modem, this image would be too slow,
but then for that, I'm planning to give people a choice of using lower
resolution images. E.g.

100 pixels high gives an 11K file, which would be fine on a 56K modem
(about 3-4 seconds download)

170 pixels high gives a 31K file, which would still be OK over a modem.

400 pixels high at 50% quality gives a 182K file, which would be fine over
broadband.


I didn't think that the image size would come down enough, but having
tried it is indeed acceptable.

I don't have an understanding of the clip property, nor of javascript,
but afaics the issue you referred to doesn't relate to either.

Using a reduced test case, setting overflow to hidden seems to resolve
your problem: http://homepage.ntlworld.ie/spartanicus/panorama.htm
I had to use an extra div due to browser bugs, the above demo seems to
work in the big three (IE, Opera and Gecko based browsers).

--
Spartanicus
May 27 '06 #8
Andy Baxter <ne***@earthsong.null.free-online.co.uk> wrote:
I still don't get why this concept is 'fatally flawed'. The only reason I
can see why images this large are a problem is because of the download
time


Btw, something else you might want to consider. Your demo causes my
system to become very slow. Each image expands to 6.6Mb uncompressed,
two of them makes for 13.2Mb. Maybe it's due to the age of my system,
but it can't handle that properly.

--
Spartanicus
May 27 '06 #9
Spartanicus said:
Andy Baxter <ne***@earthsong.null.free-online.co.uk> wrote:
I still don't get why this concept is 'fatally flawed'. The only reason I
can see why images this large are a problem is because of the download
time


Btw, something else you might want to consider. Your demo causes my
system to become very slow. Each image expands to 6.6Mb uncompressed,
two of them makes for 13.2Mb. Maybe it's due to the age of my system,
but it can't handle that properly.


I've built the image resizing bit now - you can choose between various
sizes: 400, 250, 160 and 100 pixels high, which should be good enough for
most people.

Many thanks for your help.

andy

--
http://www.niftybits.ukfsn.org/

remove 'n-u-l-l' to email me. html mail or attachments will go in the spam
bin unless notified with [html] or [attachment] in the subject line.

May 27 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: RIck Measham | last post by:
I pop up a window with a picture in it, however the picture can be very large. So here's what I want to do: Pop up a mindow with the picture clipped to the size of the window, then place a scaled...
8
by: Jeff Thies | last post by:
I'm having trouble clipping an image. My understanding is that this is all I should need: <img src="test_img.jpg" style="clip: rect(10px 10px 10px 10px)" alt="alt"> Although I've seen this as...
15
by: Anand Ganesh | last post by:
HI All, I have an Image. I want to clip a portion of it and copy to another image. How to do this? I know the bounding rectangle to clip. Any suggestions please. Thanks for your time and...
4
by: Troy | last post by:
Hi all, Im a little new to ASP.NET. I'm looking to create an image viewer that zooms in, pretty common. But I need to draw a box on the 1:1 scale image and 'zoom in' on another picture box. ...
2
by: Mark Denardo | last post by:
Hi, I need some expert GDI+ person to help me with my RoundOffImage Function: What I'm trying to do is take in an image, crop off the edges around an ellipse region I set up, and then return the...
1
by: Jim Moe | last post by:
Hello, URL: <http://tucsonwomenschorus.com/> Firefox and Opera both show the image extended to the right of the content. IE6 does not; it clips it at the boundary of the content area. Have I made...
3
by: peter.chase | last post by:
In my Web application, a have an image within a DIV. One of the allowed user gestures is to drag the image with the mouse. When dragging, parts of the image that would otherwise be displayed...
3
by: seamlyne | last post by:
The first method I ever used for multiple state buttons was to create a graphic for each button for each state: AboutUs_on, AbooutUs_over, AboutUs_out, etc. That works great when there are just a...
9
by: tshad | last post by:
Is there a way to display images (imageButtons or linkbuttons for instance) as a max size (200px by 50px) and not have it stretch the image? What I want to be able to do is limit the real estate...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.