View previous topic :: View next topic |
Author |
Message |
ryan83vt Guru
Joined: 28 Oct 2002 Posts: 370 Location: Blacksburg, VA
|
Posted: Tue Jan 28, 2003 10:46 pm Post subject: Code to resize images |
|
|
Does anyone know how to write code that can resize a jpeg image?? If I could do this then I can write my own program to create my online photo-album and save a lot of work.
This can be in c++ or perl, those are the 2 lang's I know.
Thanks! |
|
Back to top |
|
|
fghellar Bodhisattva
Joined: 10 Apr 2002 Posts: 856 Location: Porto Alegre, BR
|
|
Back to top |
|
|
idl Retired Dev
Joined: 24 Dec 2002 Posts: 1728 Location: Nottingham, UK
|
Posted: Wed Jan 29, 2003 12:15 am Post subject: |
|
|
I would also like some C or C++ code to resize PNGs |
|
Back to top |
|
|
ryan83vt Guru
Joined: 28 Oct 2002 Posts: 370 Location: Blacksburg, VA
|
|
Back to top |
|
|
Chris W l33t
Joined: 25 Jun 2002 Posts: 972 Location: Brisbane, Australia
|
Posted: Wed Jan 29, 2003 6:26 am Post subject: |
|
|
To install, which will also put the source in /usr/portage/distfiles or equivalent: Code: | # emerge imagemagick
|
You could just look at the ImageMagick home page.
Google is your friend. _________________ Cheers,
Chris W
"Common sense: The collection of prejudices acquired by age 18." -- Einstein |
|
Back to top |
|
|
ryan83vt Guru
Joined: 28 Oct 2002 Posts: 370 Location: Blacksburg, VA
|
Posted: Wed Jan 29, 2003 3:13 pm Post subject: |
|
|
yea, I've been to the home page and thats where I got the broken link to the source code. I'll try emerging. |
|
Back to top |
|
|
echeslack Tux's lil' helper
Joined: 21 Jul 2002 Posts: 131 Location: NJ, USA
|
Posted: Wed Jan 29, 2003 6:41 pm Post subject: |
|
|
I don't know that much about image processing, but I don't thing that jpeg's can be resized without decompressing the image, resizing, then recompressing (or else this functionality would probably be built into jpegtran).
I personally think you're best bet would be to use some image manipulation program (like imagemagick) to do it, and maybe their is a way to make a macro if you are going to do the same procedure repeatedly.
Otherwise I would think your best bet would be to look up libjpeg and find out how to use the open and save functions and the structures they use to store the data. The intermediate steps are pretty simple, but you would need to write a good filter to get good resizing (although the loss caused by using jpeg originally may make this unnecessary). In other words, just use an image manipulation program. There isn't really any reason to reinvent the wheel.
-ewen |
|
Back to top |
|
|
fghellar Bodhisattva
Joined: 10 Apr 2002 Posts: 856 Location: Porto Alegre, BR
|
|
Back to top |
|
|
|