🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
7 messages
7 total messages Started by poojo hackma Fri, 16 Feb 2007 16:17
JPEG info
#2579
Author: poojo hackma
Date: Fri, 16 Feb 2007 16:17
11 lines
1351 bytes
Does anyone know how to read the header info from a JPEG?

I want to get things like the Width and Height, etc.

I apologize if this has been asked before, but our company has added 
newsgroups to its list of blocked websites, so I can't browse this online. 
Luckily, they haven't found a way to block Outlook Express from reading the 
newsgroup messages!

Thanks in advance,
poojo 
Re: JPEG info
#2580
Author: Thomas Maeder [TeamB]
Date: Fri, 16 Feb 2007 17:01
25 lines
1791 bytes
"poojo hackma" <poojo.com/mail> writes:

> Does anyone know how to read the header info from a JPEG?

Certainly.


> I want to get things like the Width and Height, etc.

As for all questions regarding file formats, http://www.wotsit.org/
would be where I'd look.


> I apologize if this has been asked before, but our company has added
> newsgroups to its list of blocked websites, so I can't browse this
> online.

You have two options: change your company or change your company :-)


> Luckily, they haven't found a way to block Outlook Express from
> reading the newsgroup messages!

Interesting choice: blocking innocent web sites, but allowing
employees to use loaded weapons aimed at themselves.
Re: JPEG info
#2581
Author: poojo hackma
Date: Fri, 16 Feb 2007 19:32
10 lines
1417 bytes
Thanks Thomas.

Looks like there isn't any straight forward way to get it. I was hoping 
there was something simple, like read the DWORD at the Nth byte from the 
start of the file. What I found seems to indicate that I'd have to do a lot 
of special checking for different cases of JPEG files, and make different 
decisions based on that.

Work want this project out a little faster than that, so I'll just rig them 
up something to get by. 
Re: JPEG info
#2440
Author: Tom
Date: Sat, 17 Feb 2007 01:09
6 lines
998 bytes
> I want to get things like the Width and Height, etc.

You could load the picture wtih TJPEG and use it's
width and height properties.

-Tom
Re: JPEG info
#2444
Author: Michael Harris
Date: Sat, 17 Feb 2007 19:38
40 lines
2147 bytes
class TJpegHack : public Jpeg::TJPEGImage
{   typedef Jpeg::TJPEGImage Inherited;
public:
    virtual int __fastcall GetHeight(void)
    {
        return Inherited::GetHeight();
    };
 virtual HPALETTE __fastcall GetPalette(void)
    {
        return Inherited::GetPalette();
    };
 virtual int __fastcall GetWidth(void)
    {
        return Inherited::GetWidth();
    };
};


   std::auto_ptr<Jpeg::TJPEGImage>  pJPG(new Jpeg::TJPEGImage);
   pJPG->Assign(pBitmap.get());
   int nImageWidth =  static_cast<TJpegHack *>(pJPG.get())->GetWidth();

?
--
Michael


"poojo hackma" <poojo.com/mail> wrote in message 
news:45d606a8$1@newsgroups.borland.com...
> Thanks Thomas.
>
> Looks like there isn't any straight forward way to get it. I was hoping 
> there was something simple, like read the DWORD at the Nth byte from the 
> start of the file. What I found seems to indicate that I'd have to do a 
> lot of special checking for different cases of JPEG files, and make 
> different decisions based on that.
>
> Work want this project out a little faster than that, so I'll just rig 
> them up something to get by.
> 
Re: JPEG info
#2467
Author: Remy Lebeau (TeamB)
Date: Tue, 20 Feb 2007 18:59
12 lines
1198 bytes
"poojo hackma" <poojo.com/mail> wrote in message
news:45d5d8e7$1@newsgroups.borland.com...

> I apologize if this has been asked before, but our company has
> added newsgroups to its list of blocked websites, so I can't
> browse this online.

That is what http://www.deja.com and other public archives are for.


Gambit
Re: JPEG info
#2469
Author: poojo hackma
Date: Wed, 21 Feb 2007 20:28
8 lines
1221 bytes
Sorry. I can't get there. Our company has deja blocked. Isn't that smart of 
them?
Reason: The Websense category "Message Boards and Clubs" is filtered.

Gambit wrote:
> That is what http://www.deja.com and other public archives are for.
>
> Gambit
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads