Mantis - Squeak
Viewing Issue Advanced Details
325 Any feature always 10-10-04 15:14 03-02-06 09:27
MarcusDenker  
johnmci  
normal  
closed  
fixed  
none    
none 3.9  
0000325: JPEG export on Macs broken
Author: Mark Guzdial
Date Posted: 23 August 2004
Archive ID: 23995
Comments: These are probably well-known, but just in case they're not:

- Squeak 3.6 on Macs cannot export JPEGs. Works fine in Windows, but
on Macs, it dies with a primitive failure.
 JPEGReadWriter2SmallImagesFix.1.cs [^] (2,617 bytes) 01-12-05 01:07

Notes
(0001012)
bert   
01-07-05 18:16   
Sounds like a VM issue. It works fine with a 3.7.4 VM and a 3.6-5429 image, so I consider this resolved.
(0001028)
riks   
01-08-05 00:11   
I'm not convinced:

StarMorph new imageForm writeJPEGfileNamed: 'StarMorph.jpeg'
Fails... saying buffer too short for compressed data


| fm |
fm _ Form fromUser.
fm writeJPEGfileNamed: 'afmprog.jpeg' progressive: true.
fm writeJPEGfileNamed: 'afm.jpeg' progressive: false.
but that works

This using Squeak 3.8.5Beta1.app on a G4 Mac
(0001053)
wiz   
01-11-05 08:26   
jpeg export works on mac os9.1 vm3.8.5beta1 squeak3.9a-6548 at least it does for sketches i.e. screengrabs.
(0001054)
ScottWallace   
01-11-05 09:57   
I did not consciously "assign" this bug to myself (it's not something in which I have any expertise) but I can't seem to persuade Mantis to unassign it. If someone can figure out how to do that, please do, because this is not a bug in which I have any involvemen.

(0001058)
johnmci   
01-12-05 01:01   
for the example
StarMorph new imageForm writeJPEGfileNamed: 'StarMorph.jpeg'
we have a 28x28x32bit form. This by default creates a 784 byte ByteArray to store the results. However the resulting jpeg is 1013 bytes because the jpeg header needs some bytes, and the compression can't compress the image enough to store the data and the header information. Solution was to change
nextPutImage: aForm quality: quality progressiveJPEG: progressiveFlag and compress: aForm quality: quality to allocate an extra 1024 bytes of working storage. The result is trimmed to the actual size of the jpeg.
(0001060)
johnmci   
01-12-05 01:05   
StarMorph new imageForm writeJPEGfileNamed: 'StarMorph.jpeg'

causes error
(0001061)
johnmci   
01-12-05 01:20   
See http://www.funducode.com/freec/Fileformats/format3/format3b.htm [^]
A quick check shows creating a Form of 1x1 at 32bits requires 631 bytes of memory to store the header and the compressed bits
(0001064)
johnmci   
01-12-05 01:46   
John,

Yep fails just as you say on Windows XP SP2 with 3.7gamma last update #5976.
The buffer looks like it has been filled properly but "byteCount" is 0

Russell

I got the same results on Linux with a 3.9a-6485 image. However I
should note that I haven't updated my VM in several months now.

Ken
(0001066)
bert   
01-12-05 17:08   
update 6549smallJPEGFix-JMM.cs
(0004283)
andreas   
03-02-06 07:56   
Long since fixed.