Embedded Images Do Not Work In IMG Elements in 9.10

Forums » Opera for Windows/Mac/Linux » Opera browser

You need to be logged in to post in the forums. If you do not have an account, please sign up first.

9. January 2007, 00:19:22

Opera Software

Khadgar

Ook!

Posts: 561

Embedded Images Do Not Work In IMG Elements in 9.10

This appears to be a regression from earlier versions of Opera. In earlier versions you were able to do something like this:
<img src="data:image/png;base64,<insert base64 encoded stuff here>"/>

Something like that would show an image. It doesn't seem to do so anymore. It still does work through CSS like if you do something like this:
div
{background-image: url(data:img/png;base64,<insert base64 encoded stuff here>);}

I've set up a document that has an embedded image in it and have attached it to the post. If it worked properly should show a caution triangle with an exclamation mark in it.
test.html

I've also filed a bug report. Bug #246649.
Proud Mac Opera user!

N+ Moderator - Group for fun and everything Nintendo!

9. January 2007, 00:25:16

Opera Software

Rijk

I was here

Posts: 4117

Well, I get the warning triangle in 9.10... you didn't disable some things, like images etc? I'm using Windows, but this doesn't look like a platform issue to me.
"The real issue is about design: designing things that have the power required for the job while maintaining understandability, the feeling of control, and the pleasure of accomplishment." Don Norman
Tweak blog

9. January 2007, 00:44:50

Opera Software

Khadgar

Ook!

Posts: 561

I haven't disabled images. I checked if I triggered it accidentally again. After I made the post I tested it in Windows just to make sure and it shows up fine. Dunno. I'll see if redownloading it will work on this Mac. If not I'll test it at home to see if it works fine there. If it doesn't it might just be a Mac bug.
Proud Mac Opera user!

N+ Moderator - Group for fun and everything Nintendo!

9. January 2007, 01:08:52

Opera Software

Khadgar

Ook!

Posts: 561

Ahh I found the culprit. Stupid me. I downloaded the urifilter.ini file distributed around here and it blocked it for some reason, but I don't know why it would block it as I can't see anything in it that would do it. It's also odd that it would block it only when used in image elements. If embedded through CSS it works just fine. Urifilter usually blocks it regardless. I've attached the ini file here. I've tested it on both OS X and Windows XP with the ini file in effect and it doesn't show the image. Weird.

urlfilter.ini
Proud Mac Opera user!

N+ Moderator - Group for fun and everything Nintendo!

9. January 2007, 09:06:24

blaabjerg

Posts: 103

The base64 encoded stuff contains /AD4 which is matched by */ad4* in urlfilter.ini.

9. January 2007, 10:18:11

HaJotKE

Grumbling Hyper-Critical Cantankerous Curmudgeon!

Banned user

Nice, you got it... bigsmile

Couldn't this be considered as a flaw in the content blocking algorithm?
I believe, such base64 encoded stuff for embedded objects or generally embedded objects: shouldn't they be skipped by that algorithm... confused

But I'm no web-designer, M/B there are still other cases which could then contain ads?
OPERA V8.54 (Win NT4) & V9.27 & V9.52[b10108] & V9.62[b10467] & V10[b1413] standard on (Win 98 SE) / (Win NT4) / (Win 2000 pro)
◇◇ UserJavascript "zz-spoof-id"! ◇◇◇ [Thanks for Finally Considering this Petition!] Composing Emails in the HTML Format in Opera

9. January 2007, 16:57:30

Opera Software

Khadgar

Ook!

Posts: 561

Yeah the content filter stuff shouldn't be matching things inside base64 encoded stuff at all, actually. The encoded crap could potentially match any random block such as the /AD4 that blaabjerg found (thanks btw). I think it should disregard base64 encoded URI's unless you tell it to block base64.

People could embed ad images using base64, but it's unlikely at the present time because IE still doesn't have support for base64 encoded images (even in IE 7). It could potentially be a problem in the future if IE ever supports it as I'm sure spammers will see it as an ideal way to feed their annoying ads.
Proud Mac Opera user!

N+ Moderator - Group for fun and everything Nintendo!

9. January 2007, 17:27:17

HaJotKE

Grumbling Hyper-Critical Cantankerous Curmudgeon!

Banned user

Originally posted by Khadgar:

People could embed ad images using base64...

Never mind, if this happens, the content blocker must be able to block this image, it's still an image and also declared as such in HTML!

No need however to scan the whole base64 stuff, this has to be skipped completely.
Any SW-dev could implement this in a short time... up

BTW, did you already mention this thread in your BUG-report?
If not, could you please send an email to said report, pointing to the URL of this thread.
TIA
OPERA V8.54 (Win NT4) & V9.27 & V9.52[b10108] & V9.62[b10467] & V10[b1413] standard on (Win 98 SE) / (Win NT4) / (Win 2000 pro)
◇◇ UserJavascript "zz-spoof-id"! ◇◇◇ [Thanks for Finally Considering this Petition!] Composing Emails in the HTML Format in Opera

9. January 2007, 18:31:50

Opera Software

Khadgar

Ook!

Posts: 561

Yeah I sent an e-mail about this thread.
Proud Mac Opera user!

N+ Moderator - Group for fun and everything Nintendo!

10. January 2007, 06:41:55

xErath

javascript guru

Posts: 6588

Originally posted by Khadgar:

Yeah the content filter stuff shouldn't be matching things inside base64 encoded stuff at all, actually.


Howelse will you block a base64 encoded image ?
For a collection of user scripts visit
http://my.opera.com/xErath/blog/

10. January 2007, 09:30:11 (edited)

HaJotKE

Grumbling Hyper-Critical Cantankerous Curmudgeon!

Banned user

Originally posted by xErath:

How else will you block a base64 encoded image ?

I don't understand... confused
There's always a header, e.g. <img src=" and an end e.g. #####" with an apostrophe, the stuff in between is coded in base64 (#####...##### in my example), which has to be skipped!
Where's the problem?

In order to identify the image on the page, do some enumeration - no need to identify said image by its real (whole) contents...
OPERA V8.54 (Win NT4) & V9.27 & V9.52[b10108] & V9.62[b10467] & V10[b1413] standard on (Win 98 SE) / (Win NT4) / (Win 2000 pro)
◇◇ UserJavascript "zz-spoof-id"! ◇◇◇ [Thanks for Finally Considering this Petition!] Composing Emails in the HTML Format in Opera

10. January 2007, 10:17:00

blaabjerg

Posts: 103

I agree, the way I see it it doesn't make much sense to scan base64 encoded stuff; at least not in encoded form. Scanning after decoding might have more merit, though. This would block base64 encoded URL's as well, no?

10. January 2007, 22:49:41

xErath

javascript guru

Posts: 6588

Originally posted by HaJotKE:

Where's the problem?


Sniffing for the header blocks ALL base64 encoded images, which is very bad. Sniffing for a piece of base64 code is the right thing to do.
For a collection of user scripts visit
http://my.opera.com/xErath/blog/

10. January 2007, 23:52:40

HaJotKE

Grumbling Hyper-Critical Cantankerous Curmudgeon!

Banned user

Originally posted by xErath:

Sniffing for the header blocks ALL base64 encoded images, which is very bad.

Of course, this would be silly and that's why I didn't even think to propose such a nonsense! You forgot my enumeration solution, that's needed, for sure...
Leave that base64 stuff alone! It's not controllable.
OPERA V8.54 (Win NT4) & V9.27 & V9.52[b10108] & V9.62[b10467] & V10[b1413] standard on (Win 98 SE) / (Win NT4) / (Win 2000 pro)
◇◇ UserJavascript "zz-spoof-id"! ◇◇◇ [Thanks for Finally Considering this Petition!] Composing Emails in the HTML Format in Opera

15. January 2007, 03:43:24

xErath

javascript guru

Posts: 6588

Like I've said before, generic url filters are BAD ! And your is the worst I've seen in that regard. All dots next to asterisks were removed.

Some context:
http://thedailywtf.com/Articles/The_Great_Google_Banner_Ad_Conspiracy_.aspx
For a collection of user scripts visit
http://my.opera.com/xErath/blog/

Forums » Opera for Windows/Mac/Linux » Opera browser