473,769 Members | 6,034 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Image Q: built into browser/serving from read only directory

Not sure of best place for this question...
Are there any built in images within the browser that I can assume
(particularly IE and FF)?

More specifically, I am writing a one file webApp.php application which
needs one tiny little folder icon (e.g.
http://us.geo1.yimg.com/pic.geocitie...gr/folder.gif). Now
I could have a second file of the folder icon, but I would rather only
have one text file to distribute (namely, webApp.php). Of course, it
would be improper to reference a foreign website to get ahold of an
image each time. Therefore, if the browsers have some built in
standard images that I could access, it would be extremely helpful.

Somehow, I doubt it exists but I was bound to ask. So, here is an
alternate plan, failing that. I install the single webApp.php file.
When it is run, it checks for the existence of folder.gif in its own
directory and if it's not there, it creates the file itself (using data
embedded within webApp.php). The problem is that this doesn't cover
write protected directories (and I really want to avoid hitting a
remote server).

Now in Firefox it is possible to specify the actual bytes of an image.
In other words, I don't need to have
src="http://webAppDomain.co m/image.jpg" but can do src="data:..."
(sorry if I've messed up on the details here). However, I don't think
IE supports this yet. That is why I've been casting about for an
alternate approach.

Ultimately, I can solve this problem by pointing the image's src to
"http://webAppDomain.co m/webApp.php?getI mage=folder" and have
webApp.php spit out the image in this case, but a simpler, more
straightforward solution would be preferred.

Thanks for any tips,
Csaba Gabor from Vienna

Nov 23 '05 #1
3 1496
Csaba Gabor wrote:
Ultimately, I can solve this problem by pointing the image's src to
"http://webAppDomain.co m/webApp.php?getI mage=folder" and have
webApp.php spit out the image in this case, but a simpler, more
straightforward solution would be preferred.


This question was a technology question, and not specific to any
particular one. Therefore, even though I don't have a client side
solution I'm happy with, in the absence of other replies, and in the
interest of at least one solution, I detail what works for me, though
it is PHP and not javascript. At the top of the webApp.php file I
have:

<?php
if ($_REQUEST && $imgName = $_REQUEST['sendImage'])
sendImage($imgN ame);

function sendImage($imgN ame) {
header("Content-type: image/gif");
$gif = "GIF89a\x0F\x00 \x0D\x00\xA2\xF F\x00\xC0\xC0\x C0" .
"\xFF\xFF\x00\x C0\xC0\xC0\x80\ x80" .
"\x80\x00\x00\x 00\x00\x00\x00\ x00" .
"\x00\x00\x00\x 00\x00\x21\xF9\ x04" .
"\x01\x00\x00\x 00\x00\x2C\x00\ x00" .
"\x00\x00\x0F\x 00\x0D\x00\x40\ x03" .
"\x33\x08\x30\x CC\xFA\x6F\x80\ x20" .
"\xA8\xAD\x75\x 10\x79\x7B\x26\ x00" .
"\x21\x8E\x24\x 39\x60\x57\xD3\ x2C" .
"\x13\xEA\x06\x 1A\xF7\xA2\xDA\ xE2" .
"\x4A\x90\x82\x E7\x79\x0C\xCC\ xA9" .
"\xCD\xCF\x13\x 94\x00\x31\x31\ x95" .
"\x52\x45\x48\x 00\x00\x3B";
$size = strlen($gif);
header("Content-Length: $size bytes");
print ($gif);
exit();
}
?>

One would call this like
<img src='http://webAppDomain/webApp.php?send Image=folder'> Now it
might be that because the src is always the same, the image will be
cached and the server won't be hit again for subsequent requests. But
I forget whether or not that .php will cause the browser to ignore the
cache. If so, then what could be done is to replace that
webApp.php?send Image=folder with folder.gif and have your Apache web
browser rewrite the folder.gif request to webApp.php?send Image=folder.
Of course that steps outside the bounds of the original problem since
apache's httpd.conf file would be getting modified. Some further
comments on this approach to cacheing may be found at
http://php.net/imagecreatefrompng

Csaba Gabor from Vienna

Nov 23 '05 #2
VK

Csaba Gabor wrote:
Are there any built in images within the browser that I can assume
(particularly IE and FF)?
Yes and now - and in any case cannot be used :-)

Yes, any GUI browser uses some build-in images for its system screens
(and not only for that :-)

For example Firexox has a foxy globe:
chrome://browser/content/about.png

And IE has a bunch of little signs like
res://C:\WINDOWS\SYST EM\SHDOCLC.DLL/pagerror.gif

Netscape 4.0x will show you the original Mozilla Little Dragon - but
with French baguette in his hand - if you type about:francais

And Him only knows what else is inside of things which are not made by
ourselves, but by rather young and often joyful people. By the way, did
you read yet The Book Of Mozilla? If not then this attractive reading
is waiting for you if you type about:mozilla in Firefox.

The "no" part of my answer is: these are all local system resources so
you cannot reach them if you page has been downloaded from a server.
Also the set and exact name/location of these pictures varies greatly
from one release to another.

Now in Firefox it is possible to specify the actual bytes of an image.
In other words, I don't need to have
src="http://webAppDomain.co m/image.jpg" but can do src="data:..."
(sorry if I've messed up on the details here). However, I don't think
IE supports this yet.


"yet" is a wrong word here - we should say "still". Yes, any GUI
browser starting from NCSA Mosaic and including Internet Explorer
supports X Bitmap format - and pictures in this format can be generated
by JavaScript and inserted into <img>

So X Bitmap is totally universal solution (as long as JavaScript itself
is enabled) but this format supports only black'n'white pictures.

You may also consider VML and SVG vector graphics. VML is supported by
default by IE - but only by IE. SVG will be natively supported by
Firefox 1.5 but will require plugin right now.

Nov 23 '05 #3
On 2005-11-21, VK <sc**********@y ahoo.com> wrote:
Now in Firefox it is possible to specify the actual bytes of an image.
In other words, I don't need to have
src="http://webAppDomain.co m/image.jpg" but can do src="data:..."
(sorry if I've messed up on the details here). However, I don't think
IE supports this yet.


"yet" is a wrong word here - we should say "still". Yes, any GUI
browser starting from NCSA Mosaic and including Internet Explorer
supports X Bitmap format - and pictures in this format can be generated
by JavaScript and inserted into <img>

So X Bitmap is totally universal solution (as long as JavaScript itself
is enabled) but this format supports only black'n'white pictures.


Is there support for X Pixmap ? -
hmm xpm seems to be a rather complex format

it'd try it here but I'm running X so I'd not be sure it it was X or mozilla
rendering it.

MS-windows icon format is also supported on linux (for site icons) but
mozilla also supports other bitmaps up there (png, jpg, - even animated gifs)

Bye.
Jasen
Nov 23 '05 #4

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

Similar topics

1
2334
by: GAR | last post by:
I recently set up ampache so I can have an mp3 server. I dont like how they display album covers so I decided to try and change it a little. Instead of taking the album cover from the mp3s themselves I want it to just have a file called 'cover.jpg' in the album's direcory where when someone looks at the album the web browser will display that pic. Here is what I have so far... In the template: <img src="albumart.php?id=<?=$album?>"...
23
7728
by: Erik Schulp | last post by:
Hi all, I am using a background image via a stylsheet. I've used this code: background-image:url("/images/tile.gif"); (which I think is correct) The image doesn't show up however, the path, the filename etc etc, everything checks out ok.
6
2170
by: juglesh | last post by:
hello, here is my dir structure: /private mainaction.php img.jpg /public_html index.php in index.php, I include mainaction.php. In mainaction.php, i want to
0
2298
by: Satish Appasani | last post by:
Hi: I have a ASP.NET form with Web layout which I've achieved using panels. In one of the tab I have a File control to upload Images. When I put a file in the file control and move to another tab, I am loosing the file in the file control. So, I am putting the file in a Session: Session("PhotoFile") = filePhoto.PostedFile When the user comes back to the tab with the File upload, an Image control
17
29416
by: santel_helvis | last post by:
Hi All, Could anyone tell me how to rotate the image in javascript. Which concepts I should concentrate to rotate the image
18
6523
by: Auto | last post by:
Hello, I would like to know how do display an image into a Gridview (ASP.NET 2.0) taken directly from a DataBase, NOT using an URL, like described in this article: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/GridViewEx06.asp I have NO URL, i have the binary image inside the DB, like the field "Photo" in the table "Employees" of the "NWIND.MDB" DataBase.
1
1778
by: KoRnDragon | last post by:
I need a Javascript function that will display X random images on a page that also doesn't display the same image twice. Bonus points if it grabs the max array from the folder and sets it. Even more points if it grabs all the image names from the folder. Thanks in advance!
8
3042
by: Alexander Fischer | last post by:
Hello, I am writing a gallery script and use imagecreatefromjpeg and fpassthru to output images without any change to them (i.e., no thumbnail creation etc. - just deliver the image via the php script). However I note that the image creation is quite slow - the user can see that the image is created line-by-line, from top to bottom. Most likely this speed issue comes from PHP, since PHP is simply slower than C etc.
7
2344
by: =?Utf-8?B?TWlrZQ==?= | last post by:
Hi. I have an ASP.NET 2.0 web application which contains an Images directory with all website images. How can I prevent other websites from creating img tags with the source as my images? I want to prevent other websites from serving my image. For example - How can I prevent another website from doing this? <img src="http://mywebsitename/images/image1.jpg" Is this possible? Thanks
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10216
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9997
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.