Website Hosting for Just 20 ForumCoin ~ Advertise on ForumCoin
52 Life Tips Banner
Talk hardware, software, computer gaming, mobile devices, the Internet, social networking and other technology

Reading JPEG Code

Postby oldfriend » 10 Sep 2017, 18:02

Are you able to read the JPEG code, like on a banner?

Just curious. How does the web browser know it is showing a banner?

From the HTML code we copy and paste, there has to be a lot more code we are not seeing.

Where are the specific dimensions and images on a 460 x 60 banner located?

I understand we upload the code to a server but there has got to be some extra code somewhere for the specific banner.

Is the specific banner code written in C++ or something similar? (That the computer automatically adds.)

I use to work with Visual Basic and every single image was stored within my VBasic program.

Oldfriend
  • 0

User avatar
oldfriend
 
Posts: 1,193
Location: Central Kansas
ForumCoin: 124

Re: Reading JPEG Code

Postby Sam » 11 Sep 2017, 22:12

I was going to post this yesterday but it became too complicated. I want to keep this succinct but feel free to ask below if I haven't fully explained something.

Basically think of JPEG as a file format. It's binary and produces compressed image files. Here's another image format, SVG. The below produces a rectangle. The dimensions are easily visible with a width and height.
Code: Select all
<svg>
   <rect width="300" height="100" style="fill:rgb(0,0,255);stroke-width:3;stroke:rgb(0,0,0)" />
</svg>


Somewhere in the JPEG code will probably be the dimensions of the overall picture.

When your browser loads the index html page, it scans it and finds (usually) that there are a bunch more objects it needs (e.g. the CSS, Images, JavaScript). It sends out simultaneous requests for those objects and displays them to you.

Any Turing complete language can produce/ write JPEG. Python used to have a module for it inbuilt. C, C++ and others have libraries for encoding and decoding... e.g. http://libjpeg.sourceforge.net/.
  • 1

User avatar
Sam
 
Posts: 2,079
Location: New Zealand
Referrals: 16
ForumCoin: 229



Your Ad Here.

Return to CGT - Computers, Gaming & Technology



Who is online

Users browsing this forum: Claude [Bot] and 7 guests

Reputation System ©'