question on conversion of files

Started by
0 comments, last by nobodynews 15 years, 8 months ago
so lets say I want to take...say a jpg and convert it to my own image format of my own making...for encryption purposes perhaps. How would I find out how other formats are laid out data wise, how would I read this data, and then save it as my own type. Is it as simple as loading the file with fstream and then temporarily store it to save it to my own. or is there more involved. any tuts on this topic? alot of questions i know...for simplicity sake: 1.How would I find out how other formats are laid out data wise 2.how would I read this data 3.save it as my own type? 4.Is it as simple as loading the file with fstream and then temporarily store it to save it to my own? 5.is there more involved? 6.any tuts on this topic?
4 years of c++ and im finally starting on Win32 >.> sometimes computers are a kick in the pants
Advertisement
Quote:Original post by barouqeanxiety
so lets say I want to take...say a jpg and convert it to my own image format of my own making...for encryption purposes perhaps. How would I find out how other formats are laid out data wise, how would I read this data, and then save it as my own type. Is it as simple as loading the file with fstream and then temporarily store it to save it to my own. or is there more involved. any tuts on this topic? alot of questions i know...for simplicity sake:

1.How would I find out how other formats are laid out data wise
2.how would I read this data
3.save it as my own type?
4.Is it as simple as loading the file with fstream and then temporarily store it to save it to my own?
5.is there more involved?
6.any tuts on this topic?


If you wish to simply encrypt the file (presumably to prevent tampering) then you can simply encrypt the file, the process of which is the same regardless of the type of file. Then when you want to read the file you'd decrypt it and use it then.

However, if you really did wish to read jpeg files and convert them to your own you would need to learn the file format. I recommend here at Wotsit.org.

On the OTHER hand, there are probably libraries that already do this kind of thing for you. Here's some search results to get you started.

C++: A Dialog | C++0x Features: Part1 (lambdas, auto, static_assert) , Part 2 (rvalue references) , Part 3 (decltype) | Write Games | Fix Your Timestep!

This topic is closed to new replies.

Advertisement