473,396 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

What can I do so that this image can be saved?

http://hesterloli.dnsalias.com/test/...ript_image.htm

The image is the 100x100 px block. If we right-click in it and try to save the image we cannot. Is it possible to say set a mime-type so that it can be saved? Thanks.

--
George Hester
__________________________________
Jul 23 '05 #1
14 1747
"George Hester" <he********@hotmail.com> wrote in message
news:%R*********************@twister.nyroc.rr.com. ..
http://hesterloli.dnsalias.com/test/...ript_image.htm

The image is the 100x100 px block. If we right-click in it and try to save
the image we cannot. Is it possible to say set a mime-type so that it can
be saved? Thanks.

--
George Hester
__________________________________

What image? I got an empty square box!

Looking at your source I see that you're generating an image not displaying
one from a file.

<script>
//XBM image start
var tiny = '#define x_width 1\n';
tiny += '#define x_height 1\n';
tiny += 'static char x_bits[] = {';
tiny += '0x00'; //image data
tiny += '};';
</script>

<img src="javascript:tiny" name="Single pixel image" width="100"
height="100" border="2" />

Good luck with that; I'm not familiar with it.
Jul 23 '05 #2
"McKirahan" <Ne**@McKirahan.com> wrote in message news:fAvad.369981$Fg5.57689@attbi_s53...
"George Hester" <he********@hotmail.com> wrote in message
news:%R*********************@twister.nyroc.rr.com. ..
http://hesterloli.dnsalias.com/test/...ript_image.htm

The image is the 100x100 px block. If we right-click in it and try to save
the image we cannot. Is it possible to say set a mime-type so that it can
be saved? Thanks.

--
George Hester
__________________________________

What image? I got an empty square box!

Looking at your source I see that you're generating an image not displaying
one from a file.

<script>
//XBM image start
var tiny = '#define x_width 1\n';
tiny += '#define x_height 1\n';
tiny += 'static char x_bits[] = {';
tiny += '0x00'; //image data
tiny += '};';
</script>

<img src="javascript:tiny" name="Single pixel image" width="100"
height="100" border="2" />

Good luck with that; I'm not familiar with it.


Hi McKirahan:

It turns out this can actually be used to keep any image from being able to save from the web.
Sure a well versed Internet user probably can save the image but using this and z-index we could lay this
XBM image over say a jpg and the image would not be savable without extra work.

I haven't done it here but I did it elsewhere. Works pretty good.

I do know that the actual construction of the XBM can take a while. But it is only 1px so it shouldn't be
noicable.

George Hester
__________________________________
Jul 23 '05 #3
Lee
George Hester said:
It turns out this can actually be used to keep any image from being able =
to save from the web.


Just use screen capture.

Jul 23 '05 #4
In article <ck*********@drn.newsguy.com>, RE**************@cox.net
enlightened us with...
George Hester said:
It turns out this can actually be used to keep any image from being able =
to save from the web.


Just use screen capture.


Just use Firefox. ;)

--
--
~kaeli~
With her marriage, she got a new name and a dress.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #5
On Mon, 11 Oct 2004 10:53:30 -0500, kaeli
<ti******@NOSPAM.comcast.net> wrote:
In article <ck*********@drn.newsguy.com>, RE**************@cox.net
enlightened us with...
George Hester said:
>It turns out this can actually be used to keep any image from being able =
>to save from the web.


Just use screen capture.


Just use Firefox. ;)

--


Just look in the cache!

Jul 23 '05 #6
"Paul Cooper" <pa*********@Nobasspam.ac.uk> wrote in message news:vt********************************@4ax.com...
On Mon, 11 Oct 2004 10:53:30 -0500, kaeli
<ti******@NOSPAM.comcast.net> wrote:
In article <ck*********@drn.newsguy.com>, RE**************@cox.net
enlightened us with...
George Hester said:

>It turns out this can actually be used to keep any image from being able =
>to save from the web.

Just use screen capture.



Just use Firefox. ;)

--


Just look in the cache!


Just do many things. Except right-click Save picture... Unless of course someone knows how to set the Mime type for it. I think it is a bitmap. The official mime-type is image/x-bitmap. But then that doesn't explain the weird error when it is tried.

George Hester
__________________________________
Jul 23 '05 #7

"kaeli" <ti******@NOSPAM.comcast.net> wrote in message news:MP***********************@nntp.lucent.com...
In article <ck*********@drn.newsguy.com>, RE**************@cox.net
enlightened us with...
George Hester said:
It turns out this can actually be used to keep any image from being able =
to save from the web.


Just use screen capture.



Just use Firefox. ;)

--
--
~kaeli~
With her marriage, she got a new name and a dress.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace


Can firefox really save that image? What is the file-type it saves it as? Thanks.

George Hester
__________________________________
Jul 23 '05 #8
Lee
George Hester said:
Just do many things. Except right-click Save picture... Unless of =
course someone knows how to set the Mime type for it. I think it is a =
bitmap. The official mime-type is image/x-bitmap. But then that =
doesn't explain the weird error when it is tried.


It's not a matter of mime-type. The "source" of the image is a
Javascript function. When you try to save it, the browser tries
to rerun the function, but out of scope, so it fails.

Jul 23 '05 #9
kaeli wrote:
In article <ck*********@drn.newsguy.com>, RE**************@cox.net
enlightened us with...
George Hester said:
>It turns out this can actually be used to keep any image from being
>able = to save from the web.


Just use screen capture.


Just use Firefox. ;)


Did you try it with firefox?

--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
Jul 23 '05 #10

"Lee" <RE**************@cox.net> wrote in message news:ck*********@drn.newsguy.com...
George Hester said:
Just do many things. Except right-click Save picture... Unless of =
course someone knows how to set the Mime type for it. I think it is a =
bitmap. The official mime-type is image/x-bitmap. But then that =
doesn't explain the weird error when it is tried.


It's not a matter of mime-type. The "source" of the image is a
Javascript function. When you try to save it, the browser tries
to rerun the function, but out of scope, so it fails.


OK that's an explanation I understand. Can I write it to a file then? Permissions allowing assumed. Thanks.

George Hester
__________________________________
Jul 23 '05 #11
In article <Xn*************************@130.133.1.4>,
po********@castleamber.com enlightened us with...
kaeli wrote:
In article <ck*********@drn.newsguy.com>, RE**************@cox.net
enlightened us with...
George Hester said:

>It turns out this can actually be used to keep any image from being
>able = to save from the web.

Just use screen capture.


Just use Firefox. ;)


Did you try it with firefox?


No, sorry, I really should have looked at the file first.
I thought it was the standard garbage we see all the time here.
My bad. I should have read the whole thread. Well, we know how much I like to
make an idiot of myself now and then. (Don't say it)

That's very odd. A hex image generated by script.
And of course useless to people without javascript. And if it were a large
image, probably very bad on slow computers, but I dunno. I just know I stay
the heck away from bitmaps. *LOL*

Has anyone done this with a real, viewable image?
It's hard to play with a blank 1 pixel image.

Of course, screen caps work no matter what, but the quality isn't always that
great.

--
--
~kaeli~
A hangover is the wrath of grapes.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #12
kaeli wrote:
That's very odd. A hex image generated by script.
There are not that many browsers that understand this application of the
javascript pseudo protocol:. The image string used is a string
representation of the contents of an image file. XBM images were the
only format that could be used in Netscape < 4.04 because its string
representation was null terminated so image files containing binary, and
so including bytes with zero values, would prematurely terminate the
string definitions (XBM files are ASCII text anyway). These days that
problem is gone (though I wonder about the implications of Unicode in
this context) so in theory other image formats can be used (I have never
tried).

XBM is a two color format so it is very limited. And some browsers do
not know how to interpret it anyway (even assuming they understand the
javascript: SRC).
And of course useless to people without javascript.
And if it were a large image, probably very bad on
slow computers, but I dunno.
It is 40+ bits to the byte storage, with no compression at all. That was
never going to be quick or efficient.

<snip> Has anyone done this with a real, viewable image?
It is a means by with a script generated image can be displayed so it
has been used, as the display end or javascript games for one. With XBM
being balck and white, and alternative image file formats requiring
compression (making it too time consuming to go form a script generated
bitmap to a string containing the image data) you won't see this used
often (I don't think I have ever seen it used outside of a javascript
game).
It's hard to play with a blank 1 pixel image.
If you would like to play with some XBM images that you can see try
these two:-

var crossImg = "#define cross_width 32\n"+
"#define cross_height 32\n"+
"static char cross_bits[] = {"+
"0x00, 0x00, 0x01, 0x00, "+
"0x00, 0x00, 0x01, 0x00, "+
"0x00, 0x00, 0x01, 0x00, "+
"0x00, 0x00, 0x01, 0x00, "+
"0x00, 0x00, 0x01, 0x00, "+
"0x00, 0xe0, 0x0f, 0x00, "+
"0x00, 0x18, 0x31, 0x00, "+
"0x00, 0x04, 0x41, 0x00, "+
"0x00, 0x02, 0x81, 0x00, "+
"0x00, 0x01, 0x01, 0x01, "+
"0x80, 0x00, 0x01, 0x02, "+
"0x80, 0x00, 0x01, 0x02, "+
"0x40, 0x00, 0x01, 0x04, "+
"0x40, 0x00, 0x01, 0x04, "+
"0x40, 0x00, 0x01, 0x04, "+
"0xff, 0xff, 0xff, 0xff, "+
"0x40, 0x00, 0x01, 0x04, "+
"0x40, 0x00, 0x01, 0x04, "+
"0x40, 0x00, 0x01, 0x04, "+
"0x80, 0x00, 0x01, 0x02, "+
"0x80, 0x00, 0x01, 0x02, "+
"0x00, 0x01, 0x01, 0x01, "+
"0x00, 0x02, 0x81, 0x00, "+
"0x00, 0x04, 0x41, 0x00, "+
"0x00, 0x18, 0x31, 0x00, "+
"0x00, 0xe0, 0x0f, 0x00, "+
"0x00, 0x00, 0x01, 0x00, "+
"0x00, 0x00, 0x01, 0x00, "+
"0x00, 0x00, 0x01, 0x00, "+
"0x00, 0x00, 0x01, 0x00, "+
"0x00, 0x00, 0x01, 0x00, "+
"0x00, 0x00, 0x01, 0x00 "+
"};"

var trash = "#define trash_width 16\n"+
"#define trash_height 16\n"+
"static char trash_bits[] = {"+
"0x00, 0x01, 0xe0, 0x0f, "+
"0x10, 0x10, 0xf8, 0x3f, "+
"0x10, 0x10, 0x50, 0x15, "+
"0x50, 0x15, 0x50, 0x15, "+
"0x50, 0x15, 0x50, 0x15, "+
"0x50, 0x15, 0x50, 0x15, "+
"0x50, 0x15, 0x10, 0x10, "+
"0xe0, 0x0f, 0x00, 0x00 "+
"};";

Note that low bits in the hex numbers are to the left of the byte when
displayed as pixels, but byte order is correct: left to right, top to
bottom).
Of course, screen caps work no matter what, but
the quality isn't always that great.


As a notion of preventing the saving of images this script generated XBM
idea ranks alongside all George Hester's other ideas; best dismissed out
of hand.

Richard.
Jul 23 '05 #13
"Richard Cornford" <Ri*****@litotes.demon.co.uk> wrote in message news:ck*******************@news.demon.co.uk...
kaeli wrote:
That's very odd. A hex image generated by script.


There are not that many browsers that understand this application of the
javascript pseudo protocol:. The image string used is a string
representation of the contents of an image file. XBM images were the
only format that could be used in Netscape < 4.04 because its string
representation was null terminated so image files containing binary, and
so including bytes with zero values, would prematurely terminate the
string definitions (XBM files are ASCII text anyway). These days that
problem is gone (though I wonder about the implications of Unicode in
this context) so in theory other image formats can be used (I have never
tried).

XBM is a two color format so it is very limited. And some browsers do
not know how to interpret it anyway (even assuming they understand the
javascript: SRC).
And of course useless to people without javascript.
And if it were a large image, probably very bad on
slow computers, but I dunno.


It is 40+ bits to the byte storage, with no compression at all. That was
never going to be quick or efficient.

<snip>
Has anyone done this with a real, viewable image?


It is a means by with a script generated image can be displayed so it
has been used, as the display end or javascript games for one. With XBM
being balck and white, and alternative image file formats requiring
compression (making it too time consuming to go form a script generated
bitmap to a string containing the image data) you won't see this used
often (I don't think I have ever seen it used outside of a javascript
game).
It's hard to play with a blank 1 pixel image.


If you would like to play with some XBM images that you can see try
these two:-

var crossImg = "#define cross_width 32\n"+
"#define cross_height 32\n"+
"static char cross_bits[] = {"+
"0x00, 0x00, 0x01, 0x00, "+
"0x00, 0x00, 0x01, 0x00, "+
"0x00, 0x00, 0x01, 0x00, "+
"0x00, 0x00, 0x01, 0x00, "+
"0x00, 0x00, 0x01, 0x00, "+
"0x00, 0xe0, 0x0f, 0x00, "+
"0x00, 0x18, 0x31, 0x00, "+
"0x00, 0x04, 0x41, 0x00, "+
"0x00, 0x02, 0x81, 0x00, "+
"0x00, 0x01, 0x01, 0x01, "+
"0x80, 0x00, 0x01, 0x02, "+
"0x80, 0x00, 0x01, 0x02, "+
"0x40, 0x00, 0x01, 0x04, "+
"0x40, 0x00, 0x01, 0x04, "+
"0x40, 0x00, 0x01, 0x04, "+
"0xff, 0xff, 0xff, 0xff, "+
"0x40, 0x00, 0x01, 0x04, "+
"0x40, 0x00, 0x01, 0x04, "+
"0x40, 0x00, 0x01, 0x04, "+
"0x80, 0x00, 0x01, 0x02, "+
"0x80, 0x00, 0x01, 0x02, "+
"0x00, 0x01, 0x01, 0x01, "+
"0x00, 0x02, 0x81, 0x00, "+
"0x00, 0x04, 0x41, 0x00, "+
"0x00, 0x18, 0x31, 0x00, "+
"0x00, 0xe0, 0x0f, 0x00, "+
"0x00, 0x00, 0x01, 0x00, "+
"0x00, 0x00, 0x01, 0x00, "+
"0x00, 0x00, 0x01, 0x00, "+
"0x00, 0x00, 0x01, 0x00, "+
"0x00, 0x00, 0x01, 0x00, "+
"0x00, 0x00, 0x01, 0x00 "+
"};"

var trash = "#define trash_width 16\n"+
"#define trash_height 16\n"+
"static char trash_bits[] = {"+
"0x00, 0x01, 0xe0, 0x0f, "+
"0x10, 0x10, 0xf8, 0x3f, "+
"0x10, 0x10, 0x50, 0x15, "+
"0x50, 0x15, 0x50, 0x15, "+
"0x50, 0x15, 0x50, 0x15, "+
"0x50, 0x15, 0x50, 0x15, "+
"0x50, 0x15, 0x10, 0x10, "+
"0xe0, 0x0f, 0x00, 0x00 "+
"};";

Note that low bits in the hex numbers are to the left of the byte when
displayed as pixels, but byte order is correct: left to right, top to
bottom).
Of course, screen caps work no matter what, but
the quality isn't always that great.


As a notion of preventing the saving of images this script generated XBM
idea ranks alongside all George Hester's other ideas; best dismissed out
of hand.

Richard.


Never fails always has to do what he can to make George Hester seem like an imbecile. Thanks Richard.

You may not have noticed but the image I used is no bigger then a spacer.gif which is used pretty often on the Net. I can make that image as large as I want in the src and it don't do squat to the size.

--
George Hester
__________________________________
Jul 23 '05 #14
George Hester wrote:
Never fails always has to do what he can to make George
Hester seem like an imbecile. Thanks Richard.
There is no need to thank me, it is no effort.
You may not have noticed but the image I used is no bigger
then a spacer.gif which is used pretty often on the Net.
I can make that image as large as I want in the src and
it don't do squat to the size.


A 1px square transparent GIF is 43 bytes (assuming correct image
optimisation), XBM is bigger than that in unavoidable overheads. And you
will be hard pressed to find a graphical browser that cannot handle GIF
images, which cannot be said for XBM.

Richard.
Jul 23 '05 #15

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

Similar topics

0
by: HokieRTP | last post by:
Hello All - I am currently storing images in SQL Server and retrieving these images utilizing the code in the following KB article: ...
6
by: Peder Y | last post by:
Surely, anyone can read it's attributes and methods... Now, how does Image store the image data? How does it discern between e.g. jpg, gif and bmp. Does it know it's own size, or does one need to...
4
by: dale zhang | last post by:
Hi, I am trying to save and read an image from MS Access DB based on the following article: http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp Right now, I saved images without any...
2
by: Al | last post by:
private void GetResizedImage(string imagePath, int width, int height, string destinationDirectory, string destinationFileName) { System.Drawing.Image image = System.Drawing.Image.FromFile(...
2
by: Roel | last post by:
Hi, I'm using the ASP.NET 2.0 profile system to keep an image of members of my website "MyWebsite". Initially, I've created the property in the web.config like: <add name="Photo"...
2
by: wolverine1717 | last post by:
hello, plz help me to upload an image to the server directory. my requirements are: 1. the uploaded image should be saved in a folder in the server. 2. the uploaded image should be saved as...
3
by: Mutant Merv | last post by:
Sorry all it's me again. Can you see from the following why my picture will not appear on the web page. <html> <head> <title>Bubble & Suds</title> </head> <img src="bs3.jpg" /> <body...
2
by: kimiraikkonen | last post by:
Hello, I want to save a picture using that code and i have a read-only textbox on the picturebox1 named "textbox2". I want users to enter their custom text using "textbox1" and save the image...
2
by: raylopez99 | last post by:
I can't get the below code to work, no matter how many times I change it. I do have the Image file, Image1, created (in another method), and using "hard coding" I can save it (it's a filled...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.