Loading...

quicktime-api@lists.apple.com

[Prev] Thread [Next]  |  [Prev] Date [Next]

Random images extracted using [QTMovie currentFrameImage] are scaled incorrectly Nick Forge Wed Oct 31 12:05:51 2007

<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; 
-webkit-line-break: after-white-space; "><div style="margin-top: 0px; 
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font 
face="Helvetica" size="3" style="font: 12.0px Helvetica">I have an app that 
extracts the frames of a movie using [QTMovie currentFrameImage]. The NSImages 
are then exported to an obscure file format, for use with other software. With 
a particular movie I have, a few of the frames get vertically scaled - i.e. the 
top of the image is where it should be, but the bottom is stretched "up" a bit, 
and there is a few pixels of whitespace at the bottom. I have bypassed my own 
exporting code by using the following code to export the first 
frame:</font></div><div style="margin-top: 0px; margin-right: 0px; 
margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 
Helvetica; min-height: 14px; "><br></div><div style="margin-top: 0px; 
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Monaco" 
size="3" style="font: 11.0px Monaco"><span class="Apple-tab-span" 
style="white-space:pre">       </span>NSData *data = [[movie currentFrameImage] 
TIFFRepresentation];</font></div><div style="margin-top: 0px; margin-right: 
0px; margin-bottom: 0px; margin-left: 0px; "><font face="Monaco" size="3" 
style="font: 11.0px Monaco"><span class="Apple-tab-span" 
style="white-space:pre">        </span>[data writeToFile:</font><font 
face="Monaco" size="3" color="#6a221d" style="font: 11.0px Monaco; color: 
#6a221d">@"firstframe.tiff"</font><font face="Monaco" size="3" style="font: 
11.0px Monaco"> options:</font><font face="Monaco" size="3" color="#132df1" 
style="font: 11.0px Monaco; color: #132df1">0</font><font face="Monaco" 
size="3" style="font: 11.0px Monaco"> error:</font><font face="Monaco" size="3" 
color="#132df1" style="font: 11.0px Monaco; color: #132df1">0</font><font 
face="Monaco" size="3" style="font: 11.0px Monaco">];</font></div><div 
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 
0px; "><font face="Monaco" size="3" style="font: 11.0px Monaco"><span 
class="Apple-tab-span" style="white-space:pre">      </span>[movie 
stepForward];</font></div><div style="margin-top: 0px; margin-right: 0px; 
margin-bottom: 0px; margin-left: 0px; "><font face="Monaco" size="3" 
style="font: 11.0px Monaco"><span class="Apple-tab-span" 
style="white-space:pre">  </span>data = [[movie currentFrameImage] 
TIFFRepresentation];</font></div><div style="margin-top: 0px; margin-right: 
0px; margin-bottom: 0px; margin-left: 0px; "><font face="Monaco" size="3" 
style="font: 11.0px Monaco"><span class="Apple-tab-span" 
style="white-space:pre">        </span>[data writeToFile:</font><font 
face="Monaco" size="3" color="#6a221d" style="font: 11.0px Monaco; color: 
#6a221d">@"secondframe.tiff"</font><font face="Monaco" size="3" style="font: 
11.0px Monaco"> options:</font><font face="Monaco" size="3" color="#132df1" 
style="font: 11.0px Monaco; color: #132df1">0</font><font face="Monaco" 
size="3" style="font: 11.0px Monaco"> error:</font><font face="Monaco" size="3" 
color="#132df1" style="font: 11.0px Monaco; color: #132df1">0</font><font 
face="Monaco" size="3" style="font: 11.0px Monaco">];</font></div><div 
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 
0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; 
"><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; 
margin-left: 0px; "><font face="Helvetica" size="3" style="font: 12.0px 
Helvetica">Using this code, the first two frames come out like this: 
</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 
0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; 
min-height: 14px; "><br></div> <img 
src="cid:413A6B41-3665-4E03-8941-3369AFE2CCD3@local"><img 
src="cid:C745DAF3-7690-4DF9-936E-C65CEDA9996B@local"><br><div 
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 
0px; font: normal normal normal 12px/normal Helvetica; min-height: 14px; 
"><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; 
margin-left: 0px; font: normal normal normal 12px/normal Helvetica; min-height: 
14px; "><br></div> <br><div style="margin-top: 0px; margin-right: 0px; 
margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 
Helvetica; min-height: 14px; "><br></div><div style="margin-top: 0px; 
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font 
face="Helvetica" size="3" style="font: 12.0px Helvetica">They should look 
virtually identical - that scaling is definitely not present in the original 
movie. I noticed this in 2 separate movies files. (I converted them to JPEG so 
they'd be within the mailing list 40KB limit)</font></div><div 
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 
0px; font: normal normal normal 12px/normal Helvetica; min-height: 14px; 
"><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; 
margin-left: 0px; "><font face="Helvetica" size="3" style="font: 12.0px 
Helvetica">Is this a known bug? On this particular movie, 3 frames come out 
vertically scaled.</font></div><div style="margin-top: 0px; margin-right: 0px; 
margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 
Helvetica; min-height: 14px; "><br></div><div style="margin-top: 0px; 
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font 
face="Helvetica" size="3" style="font: 12.0px 
Helvetica">Thanks,</font></div><div style="margin-top: 0px; margin-right: 0px; 
margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" 
style="font: 12.0px Helvetica">Nick</font></div> 
</body></html>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      ([EMAIL PROTECTED])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-api/alexiscircle%40gmail.com

This email sent to [EMAIL PROTECTED]