Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 04-19-2005, 04:25 AM   #1 (permalink)
Nielszz
Nielszzz
 
Nielszz's Avatar
 
Join Date: Apr 2005
Location: Holland!!
Posts: 13
Nielszz is on a distinguished road
Need help c++ builder OpenPictureDialog error

Hello,

I have a problem i have builded some thing that can open pictures and load them into a TImage...

i can open *.bmp's and some more standards *.jpg and *.jpeg are in my filter list too but if i want to open them it crashes and say: "Project blablabla.exe raised an exception class EInvalidGraphic with message 'unknown file extension' (.jpg) process stopped....."

what can i do to load a jpg

thx already
Nielszz is offline   Reply With Quote
Old 04-19-2005, 04:36 AM   #2 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,693
redhead is on a distinguished road
I moved the thread, since this sounds like a API specific thing..
Are you sure your jpg decompression algorithm is correct ?
You do know that .bmp/.tif arent compressed, but .jpg are ?
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 04-19-2005, 04:38 AM   #3 (permalink)
Nielszz
Nielszzz
 
Nielszz's Avatar
 
Join Date: Apr 2005
Location: Holland!!
Posts: 13
Nielszz is on a distinguished road
Yes i did know that jpg is a compressed type of picture, i am still a noob in c++ sow i would not know what this means: "Are you sure your jpg decompression algorithm is correct"

but thx for the reply
Nielszz is offline   Reply With Quote
Old 04-19-2005, 05:04 AM   #4 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,693
redhead is on a distinguished road
When reading .bmp/.tiff you basicaly read a header, defining image size/color palete and the like, the rest of the image you just read in a steady stream, not much conversion/decompression of any kind, virtualy any imagelibrary provide buildin support for those kind.

With .jpg you read a header, telling image size, color palete, compression rate, and from that moment on you read a compressed image, here is a small representation:
Code:
    0 represents black
    1 represents white

Orriginal image:
     11111111000011111011111000000111
Compressed image:
     8x1;4x0;5x1;1x0;5x1;6x0;3x1
Thus when reading the image you won't read the lines of 1 and 0 and display as read, which you would with .bmp/.tiff, but instead you read the compressed portion, which is declared by the compression rate from the header.
If at some point the read algorithm isn't supporting the compresssion which the header tells it to use, you'd end up with an error like the one you describe.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 04-19-2005, 05:27 AM   #5 (permalink)
Nielszz
Nielszzz
 
Nielszz's Avatar
 
Join Date: Apr 2005
Location: Holland!!
Posts: 13
Nielszz is on a distinguished road
Oke wait a sec i having some difficulties to read it, i dont understand it completly
Nielszz is offline   Reply With Quote
Old 04-19-2005, 05:32 AM   #6 (permalink)
Nielszz
Nielszzz
 
Nielszz's Avatar
 
Join Date: Apr 2005
Location: Holland!!
Posts: 13
Nielszz is on a distinguished road
Ok untill so far i understand but what can i do exactly to solve this problem...? i am very new in using borland c++ builder i tried to find some info in the help files but i didn't come up with anything...
Nielszz is offline   Reply With Quote
Old 04-19-2005, 08:26 AM   #7 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 651
DJMaze is on a distinguished road
You need to include/load the Borland vcljpgxx.lib file (where xx is your BCB version like vcljpg40 or vcljpg50)
DJMaze is offline   Reply With Quote
Old 04-19-2005, 08:29 AM   #8 (permalink)
Nielszz
Nielszzz
 
Nielszz's Avatar
 
Join Date: Apr 2005
Location: Holland!!
Posts: 13
Nielszz is on a distinguished road
Thx i will try....
Nielszz is offline   Reply With Quote
Old 04-19-2005, 12:12 PM   #9 (permalink)
Nielszz
Nielszzz
 
Nielszz's Avatar
 
Join Date: Apr 2005
Location: Holland!!
Posts: 13
Nielszz is on a distinguished road
how do i add something like that in c++ builder whats the line?
Nielszz is offline   Reply With Quote
Old 04-19-2005, 04:03 PM   #10 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 651
DJMaze is on a distinguished road
There are several ways.

1) Project -> Options -> Packages (tab) -> Build with runtime packages

2) Project -> Add to project

3) Open the .cpp
PHP Code:
#pragma link "C:/Program Files/Borland/CBuilder4/Lib/vcljpg40.lib" 
DJMaze is offline   Reply With Quote
Old 04-20-2005, 02:16 AM   #11 (permalink)
Nielszz
Nielszzz
 
Nielszz's Avatar
 
Join Date: Apr 2005
Location: Holland!!
Posts: 13
Nielszz is on a distinguished road
I have tried but i noticed that i dont have a vcljpg60.lib on my hard disk and if i try to add a package ( vlcjpg60.bpl) it says that i already have the package because its standard in c++ builder the file (vlcjpg60.bpl is located at c:\windows\system32) but why cant i use ist???

it is realy getting enoying
Nielszz is offline   Reply With Quote
Old 04-23-2005, 01:29 AM   #12 (permalink)
Nielszz
Nielszzz
 
Nielszz's Avatar
 
Join Date: Apr 2005
Location: Holland!!
Posts: 13
Nielszz is on a distinguished road
Help anyone?
Nielszz is offline   Reply With Quote
Old 04-23-2005, 11:19 AM   #13 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,693
redhead is on a distinguished road
Sorry, I wanted to help if I could, but since I've never used Borland C++ builder I have no idear where this specific file might orriginate, or how to include it in your project.
Now if this had paned out in a matter of fixing a ANSI/ISO C++ reading algorithm then I'm here.. But with this API specific library routine, I'm out of options.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 04-23-2005, 12:44 PM   #14 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 651
DJMaze is on a distinguished road
Try vcljpg60.bpl instead of .lib atleast one of them must exist
DJMaze is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Perplexing Error on C Code etorres Standard C, C++ 6 03-24-2005 08:16 PM
What is this error? john_tran Standard C, C++ 4 10-20-2004 08:30 PM
edit? anon Lounge 10 11-21-2002 03:02 PM


All times are GMT -8. The time now is 12:18 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting