RMagick .psd to .jpg cannot load in browsers
- From: "icvu" <icvu.mba@xxxxxxxxx>
- Date: 8 Sep 2006 10:16:01 -0700
Hello Everyone, I am new to the group and I hope someone can help me.
I have been working on a project that requires me to convert images
from one file format to the other. More specifically, from .psd to
..jpg. I use RMagick to do the image resizing and format conversion. The
conversion worked but the thumbnails, in .jpg, can only be viewed by my
system (Win XP pro) applications such as Fireworks, Windows Picture and
Fax Viewer, and Windows Explorer. The thumbnails cannot be viewed using
any browser. They red "X" showed up as if the images are missing and
the browsers do not seem to recognize their file format, which is
supposed to be ".jpg"
Below is my code. I appreciate any help that could lead me toward a
solution. Thanks in advance - icvu
def createThumbnail(data, imgDir)
fileName = "#{data[1]} #{data[3]}.psd"
imgName = fileName.reverse[4,fileName.length].reverse
img = Magick::Image.read("#{imgDir}#{fileName}").first
width, height = 60,60
thumb = img.resize(width,height)
thumbPath = "#{imgDir}thumb\\"
Dir.mkdir thumbPath unless File.exists? thumbPath
imgThumb = "#{thumbPath}#{imgName}.jpg"
thumb.write(imgThumb)
end
.
- Follow-Ups:
- Re: RMagick .psd to .jpg cannot load in browsers
- From: Mike Dvorkin
- Re: RMagick .psd to .jpg cannot load in browsers
- Prev by Date: Re: symbol tricks
- Next by Date: Re: OT: Windows equivalent of -ps
- Previous by thread: Is Matz dropping continuations being dropped in 2.0?
- Next by thread: Re: RMagick .psd to .jpg cannot load in browsers
- Index(es):
Relevant Pages
|