为什么UIImageJPEGRepresentation和UIImagePNGRepresentation会增加数据大小?

时间:2017-02-20 14:13:12

标签: ios swift uiimage

进行图像缩放以使图像限制在320x480,因此FILE_NAME = 'file.txt' empty_line_count = 0 with open(FILE_NAME,'r') as fh: for line in fh: # The split method will split the word into list. if the line is # empty the split will return an empty list. ' == [] ' this will # check the list is empty or not. if line.split() == []: empty_line_count += 1 print('Empty Line Count : ' , empty_line_count) < = 320且w< = 640.但在转换为数据并向后转换为图像后,我得到两次最初的大图像。为什么?我怎么能避免?应该使用160x320尺寸来获得所需的尺寸吗?

h
  

(lldb)po newImage!.size▿(320.0,213.5)      - 宽度:320.0      - 身高:213.5

     

(lldb)po image3!.size▿(640.0,427.0)      - 宽度:640.0      - 身高:427.0

0 个答案:

没有答案