NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 48 49 50 51 52 … 93 Next »
Image Location in FireFox Help Needed

 
  • 0 Vote(s) - 0 Average
Image Location in FireFox Help Needed
UncleJohnsBand
Offline

Posting Freak

U.S.A.
Posts: 5,643
Threads: 258
Joined: Feb 2005
#1
2006-11-18, 04:55 PM
I am in the process of adding the ability to view your photos via EWA. I have it working fine in IE but now that I am testing with FireFox my images will not display.

Here is the line of code that I am using to set the image control on the page:

Code:
picture.ImageUrl = Convert.ToString(PublicDownload.Deseralize(Request.Params["pic"]));
The address (from image property) that shows up when viewing in IE looks like this (this works fine):
Code:
file://naslite-smbg/Disk-4/Pictures/Baltimore%202003/Baltimore%202003%20002.jpg
The address (from image property) that shows up when viewing in FireFox looks like this (this does not work):
Code:
http://localhost:7647/gbpvr/%5C%5CNaslite-smbg%5CDisk-4%5CPictures%5CBaltimore%202003%5CBaltimore%202003%20001.jpg
The value of the deserialized location looks like this (This is a mapped location...UNC encoding):
Code:
\\Naslite-smbg\Disk-4\Pictures\Baltimore 2003\Baltimore 2003 001.jpg
Anyone have any ideas? I did try doing a UrlEncode on the returned image location but that did not work.
Intel Core i7 @ 4.00GHz Skylake 14nm
ASUSTeK COMPUTER INC. Z170-DELUXE
Windows 10 Pro x64
PVR Software: NPVR 5.1.1
SiliconDust HDHomeRun HDHR5-4US Connect Quatro 4 Channel Tuner
Roku Ultra
2 PCH A-100's
UncleJohnsBand
Offline

Posting Freak

U.S.A.
Posts: 5,643
Threads: 258
Joined: Feb 2005
#2
2006-11-18, 08:41 PM
Ok....I have updated my code to corrctly use a URI format.....still works in IE but with Firefox it does not.

But if I select the image location from the properties (right click on bad image link and copy/paste image location) into the address bar of the browser it works fine.

Code:
picture.ImageUrl = "file:///" + Convert.ToString(PublicDownload.Deseralize(Request.Params["pic"])).Replace("\\","/");
Here is what is now in the image property......
Code:
file://///Naslite-smbg/Disk-4/Pictures/Baltimore%202003/Baltimore%202003%20001.jpg
If I can't get this to work I will need to make this an IE only item and dynamically turn it off and on.....which I really don't want to do.

I have tried turning off the security.checkloaduri setting in firefox with no change. I have even tried to create a user.js file that turns of the checking as well....with no luck. Found this info on the Mozila site.
Intel Core i7 @ 4.00GHz Skylake 14nm
ASUSTeK COMPUTER INC. Z170-DELUXE
Windows 10 Pro x64
PVR Software: NPVR 5.1.1
SiliconDust HDHomeRun HDHR5-4US Connect Quatro 4 Channel Tuner
Roku Ultra
2 PCH A-100's
UncleJohnsBand
Offline

Posting Freak

U.S.A.
Posts: 5,643
Threads: 258
Joined: Feb 2005
#3
2006-11-18, 10:36 PM
Ok....finally figured this thing out. This works for FireFox 1.5 ==> 2.x.

You must create a uers.js file and store it in your FireFox Profile Directory.

By default this location is:

c:\documents and settings\users\user name\application data\mozilla\firefox\profiles\default

The user.js file should contain the following lines of code:
Code:
user_pref("capability.policy.policynames", "localfilelinks");
user_pref("capability.policy.localfilelinks.sites", " http://[B]gbpvrwebsitename_or_IP[/B]:7647 ");
user_pref("capability.policy.localfilelinks.checkloaduri.enabled", "allAccess");
This code will turn off the loaduri security for the site(s) listed in the .sites line. To add more then one site (i.e. you have a local name as well as an external website name) just seperate the website names with a space.
Intel Core i7 @ 4.00GHz Skylake 14nm
ASUSTeK COMPUTER INC. Z170-DELUXE
Windows 10 Pro x64
PVR Software: NPVR 5.1.1
SiliconDust HDHomeRun HDHR5-4US Connect Quatro 4 Channel Tuner
Roku Ultra
2 PCH A-100's
KingArgyle
Offline

Posting Freak

Posts: 1,271
Threads: 95
Joined: Nov 2004
#4
2006-11-19, 02:41 AM
Any particular reason that you don't just stream the file to the web browser? If you give it the correct Header information before sending it, it would allow for the images to be displayed without having to do any type of customization to the browser, and would make it more universal.
UncleJohnsBand
Offline

Posting Freak

U.S.A.
Posts: 5,643
Threads: 258
Joined: Feb 2005
#5
2006-11-19, 04:02 AM
KingArgyle Wrote:Any particular reason that you don't just stream the file to the web browser? If you give it the correct Header information before sending it, it would allow for the images to be displayed without having to do any type of customization to the browser, and would make it more universal.

I want to be able to size the image.....rather than having to display a 1280x960 image I want to be able to at least cut it in half and perhaps add a way (i.e. radiobuttons) to pick your own resolution.

When you stream I am not aware of a way to change the size of the image being streamed.

Using the image control the size is controllable.

This is what it looks like at this point:
[Image: capture11182006105812pmoo5.jpg]
Intel Core i7 @ 4.00GHz Skylake 14nm
ASUSTeK COMPUTER INC. Z170-DELUXE
Windows 10 Pro x64
PVR Software: NPVR 5.1.1
SiliconDust HDHomeRun HDHR5-4US Connect Quatro 4 Channel Tuner
Roku Ultra
2 PCH A-100's
KingArgyle
Offline

Posting Freak

Posts: 1,271
Threads: 95
Joined: Nov 2004
#6
2006-11-19, 04:53 AM
How does this work if you don't have access to the network drive?

I think a more portable and not as dependent on Windows way of doing it, is to have the server hide the operating system specifics from the client, and have the server serve up the directory and images. Is there a way in Casani to include the image directories as one of the url's served up by the server? If so, then a standard url would work for showing the images, and you could still resize the pages.

It seems that the .Net control you are using requires a file:/// url, which won't work if you access the site remotely, or the machine you are on doesn't have access to the server that GBPVR is installed on.

As for doing file resizing of a stream, here is a link that shows some .Net code on resizing JPEGs.

http://java.about.com/library/weekly/aa_img_resize.htm
UncleJohnsBand
Offline

Posting Freak

U.S.A.
Posts: 5,643
Threads: 258
Joined: Feb 2005
#7
2006-11-19, 05:39 AM
KingArgyle Wrote:How does this work if you don't have access to the network drive?

I think a more portable and not as dependent on Windows way of doing it, is to have the server hide the operating system specifics from the client, and have the server serve up the directory and images. Is there a way in Casani to include the image directories as one of the url's served up by the server? If so, then a standard url would work for showing the images, and you could still resize the pages.

It seems that the .Net control you are using requires a file:/// url, which won't work if you access the site remotely, or the machine you are on doesn't have access to the server that GBPVR is installed on.

As for doing file resizing of a stream, here is a link that shows some .Net code on resizing JPEGs.

http://java.about.com/library/weekly/aa_img_resize.htm

The control and resulting image are executed on the server side so the app has access to the file share....the image control doesn't need the file:/// URI.....but FireFox does. IE is fine with just the UNC encoded location of the image.....FireFox is not....from what I can tell it is just a different security model in FireFox.

I have no issue accessing images outside the network.....works fine. I am not sure this is really a "windows" way of doing it. The only thing that is exposed to the user is the location of the image on the network or drive(if they pull up the properties of the displayed image).....if you copy that location into your browser outside of the network it will fail(which is good).

Not sure if Casini could do that or not....that would be something sub would need to code up in such a way to handle multiple folders on different drives or network shares. Not sure if that is easy or not.

I did try the thumbnail aproach (along with a couple of other options to stream) but many cameras (including mine) store a actual thumbnail within the image itself. When you use the image.getthumbnail method it pulls that image....then when you scale to 640x480 there is major pixleation.
Intel Core i7 @ 4.00GHz Skylake 14nm
ASUSTeK COMPUTER INC. Z170-DELUXE
Windows 10 Pro x64
PVR Software: NPVR 5.1.1
SiliconDust HDHomeRun HDHR5-4US Connect Quatro 4 Channel Tuner
Roku Ultra
2 PCH A-100's
KingArgyle
Offline

Posting Freak

Posts: 1,271
Threads: 95
Joined: Nov 2004
#8
2006-11-19, 04:10 PM
I guess what I was looking for was not having to have the UNC in the URL at all. What I was suggesting was a virtual directory for the images. I don't think cassini itself has built in support for this, but there is an enhanced version called CassiniEx which does support virtual directories.

The advantage is that if I wanted to access my pictures from a computer that didn't have access to the network drive to view them, then the image can be viewed as if it were just in another directory on the existing web server. To me, changing the way FireFox has it's default preferences setup just to be able to access an image isn't the correct way to address the problem. It's a short cut method. A couple of different ways would be to either:

1. Have the images directory physically under the gbpvr webserver directory. (Not the recommended way)

2. Have the site wrap the UNC so that it isn't included in the URL or as a file:/// option. The script it self would access the files to be displayed, but it would appear to be as a http:// request instead of a file request. Again, I'm not familiar enough with the .Net control you are using to do this, and it may mean more work than just using an existing control to do it. However, I think it keeps the access method browser independent, and doesn't have people change their security settings or configuration files.

I just don't like the idea of having people to mess around with their configuration settings, to get it to work on a different browser when their are ways to get it to work without changing browser settings.

As for the Thumbnails. If an image already has a thumbnail in it why not just stream the thumbnail itself? Maybe I'm misunderstanding that problem.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,789
Threads: 769
Joined: Nov 2003
#9
2006-11-19, 04:42 PM
Yeah, I'd be streaming it also.

I'd do something like having a ImageSrv.aspx, which takes a filename parameter (or probably just a hash of the filename for security), then sets the mime type appropriately, opens the file (name found via a hash lookup in a table) and writes the contents of the file to the response object.

This way the original page can just have <img src="ImageSrv.aspx?p=1AG4SH6WT"> type tags. After the browser reads this page, it'll call back to ImageSrv.aspx to get the images, which are dynamically streamed back to the user.

You can probably add an additional parameter to the same page to tell it to return the thumbnail version. This most likely involve loading the image using "Image.FromFile()", then creating a new bitmap of the desired thumbnail size, then using Graphics.FromImage(image).DrawImage(...) to draw the image into the thumbnail, then streaming it out to the ASPX response object.
UncleJohnsBand
Offline

Posting Freak

U.S.A.
Posts: 5,643
Threads: 258
Joined: Feb 2005
#10
2006-11-20, 01:23 AM
sub Wrote:Yeah, I'd be streaming it also.

I'd do something like having a ImageSrv.aspx, which takes a filename parameter (or probably just a hash of the filename for security), then sets the mime type appropriately, opens the file (name found via a hash lookup in a table) and writes the contents of the file to the response object.

This way the original page can just have <img src="ImageSrv.aspx?p=1AG4SH6WT"> type tags. After the browser reads this page, it'll call back to ImageSrv.aspx to get the images, which are dynamically streamed back to the user.

You can probably add an additional parameter to the same page to tell it to return the thumbnail version. This most likely involve loading the image using "Image.FromFile()", then creating a new bitmap of the desired thumbnail size, then using Graphics.FromImage(image).DrawImage(...) to draw the image into the thumbnail, then streaming it out to the ASPX response object.

That is basically what is happening except instead of streaming to the browser (which I did do) I use the image component. The streaming works fine but you are forced to have the image show as the original size....so if you run in 1024x768 display mode and your pictures are 1280x960 (which is on the small size for today's digital images) you get scroll bars and have to scroll around to see the whole picture.

The image control lets you size the original picture so that it fits in a reasonable size image with great quality and no scroll bars.

The setup I have now has 3 pages.....The PhotoViwer which is the main access page. It has two IFrames on it for the other 2 pages. The other two pages are the Directory listing which loads up the locations in a serilzed encoding and when clicked on sends the picture location to the Photo page wich deserilaizes the picture location and then sets the image URL on the .Net 2.0 Image component.

I am fairly certain I did the new bitmap then image.fromfile process when I was playing around with the streaming. I will try that again but if I recall correctly the quility was not good at all.

I'll let you know how streaming comes out this time.
Intel Core i7 @ 4.00GHz Skylake 14nm
ASUSTeK COMPUTER INC. Z170-DELUXE
Windows 10 Pro x64
PVR Software: NPVR 5.1.1
SiliconDust HDHomeRun HDHR5-4US Connect Quatro 4 Channel Tuner
Roku Ultra
2 PCH A-100's
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): 1 2 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  Skin help (correct location?) SFX Group 4 3,946 2018-01-24, 07:42 AM
Last Post: pBS
  Coverart / fanart image sizes??? bgowland 3 2,305 2014-02-16, 11:50 PM
Last Post: bgowland
  New web service clarification needed bgowland 6 3,345 2013-10-19, 02:36 AM
Last Post: bgowland
  Where does this image come from? bgowland 4 2,459 2013-02-13, 07:26 PM
Last Post: bgowland
  Problem with preview image for Pending Recordings Northpole 2 2,059 2012-08-14, 02:56 AM
Last Post: Northpole
  FanArt & displaying a background image Jaggy 2 1,782 2012-01-31, 11:39 PM
Last Post: sub
  Skin help needed for EventDetails.xml bgowland 7 3,440 2011-06-26, 11:55 PM
Last Post: Jaggy
  Which channel logo image formats does npvr support? bgowland 2 2,141 2011-03-06, 05:43 AM
Last Post: bgowland
  Image Caching imilne 6 2,605 2011-01-01, 11:45 PM
Last Post: sub
  MVP/NMT testers needed for Weather2 scb147 46 12,327 2010-03-03, 08:12 PM
Last Post: scb147

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode