RMagick .psd to .jpg cannot load in browsers



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

.



Relevant Pages

  • Re: RMagick .psd to .jpg cannot load in browsers
    ... It's a good indication that either HTML headers are not set up properly or your code generates some error messages instead of binary .jpg content. ... from one file format to the other. ... any browser. ... Dir.mkdir thumbPath unless File.exists? ...
    (comp.lang.ruby)
  • Re: Making a booklet....... aarrrrgh!
    ... importing RAW images. ... specific colour is possibly easier with LaTeX than it is with a GUI ... but the big `issue' with TeX is that unless you're actually using ... of graphics file format (I think it's two, but I can't be arsed checking ...
    (uk.comp.sys.mac)
  • Re: Some inserted graphics present in DOC, most not
    ... I think you've done an excellent job of summarizing the problem, and I'm afraid ... Open in Word 2003 and save in XML file format. ... are also on a network drive in another folder. ... I have copied the doc and the images folder ...
    (microsoft.public.word.drawing.graphics)
  • Re: Archival Scanning
    ... suggested file format for archiving? ... Just getting the images on a hard disk is just the first ... The harddrive and DVDs won't last forever both have to be replaced ...
    (comp.periphs.scanners)
  • Re: A little help getting started with DICOM
    ... You can think of each IOD as one specific file format. ... formats for CT images, MR images, X-ray images, Ultrasound etc. ... DICOM has many different sets of encoding rules (big endian, little endian, ...
    (comp.protocols.dicom)