Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Code to resize images
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
ryan83vt
Guru
Guru


Joined: 28 Oct 2002
Posts: 370
Location: Blacksburg, VA

PostPosted: Tue Jan 28, 2003 10:46 pm    Post subject: Code to resize images Reply with quote

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
View user's profile Send private message
fghellar
Bodhisattva
Bodhisattva


Joined: 10 Apr 2002
Posts: 856
Location: Porto Alegre, BR

PostPosted: Tue Jan 28, 2003 10:58 pm    Post subject: Reply with quote

You could try ImageMagick.
_________________
| www.gentoo.org | www.tldp.org | www.google.com |
Back to top
View user's profile Send private message
idl
Retired Dev
Retired Dev


Joined: 24 Dec 2002
Posts: 1728
Location: Nottingham, UK

PostPosted: Wed Jan 29, 2003 12:15 am    Post subject: Reply with quote

I would also like some C or C++ code to resize PNGs
Back to top
View user's profile Send private message
ryan83vt
Guru
Guru


Joined: 28 Oct 2002
Posts: 370
Location: Blacksburg, VA

PostPosted: Wed Jan 29, 2003 5:38 am    Post subject: Reply with quote

fghellar wrote:
You could try ImageMagick.

Do you have the source for this? The link
ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-5.4.8.tar.gz is broken, and since I don't have Red Hat (obviously) I can't use the binaries (I dont think).
Back to top
View user's profile Send private message
Chris W
l33t
l33t


Joined: 25 Jun 2002
Posts: 972
Location: Brisbane, Australia

PostPosted: Wed Jan 29, 2003 6:26 am    Post subject: Reply with quote

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
View user's profile Send private message
ryan83vt
Guru
Guru


Joined: 28 Oct 2002
Posts: 370
Location: Blacksburg, VA

PostPosted: Wed Jan 29, 2003 3:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
echeslack
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jul 2002
Posts: 131
Location: NJ, USA

PostPosted: Wed Jan 29, 2003 6:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
fghellar
Bodhisattva
Bodhisattva


Joined: 10 Apr 2002
Posts: 856
Location: Porto Alegre, BR

PostPosted: Wed Jan 29, 2003 6:43 pm    Post subject: Reply with quote

ryan83vt wrote:
The link
ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-5.4.8.tar.gz is broken

Try the parent directoy: ftp://ftp.imagemagick.org/pub/ImageMagick/. It works and has a newer version. Maybe they forgot to update the link when they removed the older one.
_________________
| www.gentoo.org | www.tldp.org | www.google.com |
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum