system("rm -f '#{destfile}'")
xmlelem.add_attribute("#{attributes_prefix}white-balance", save_whitebalance)
$modified_pixbufs[thumbnail_img][:angle_to_orig] = 0
- if entry2type(orig) == 'video'
- #- cleanup temp for videos
- system("rm -f #{current_dest_dir}/screenshot.jpg000000.jpg")
- end
end
$modified_pixbufs[thumbnail_img] ||= {}
gen_real_thumbnail_core(type, origfile, destfile, xmldir, size, infotype)
gtk_thread_protect { img.set(destfile) }
$modified_pixbufs[destfile] = { :orig => img.pixbuf, :pixbuf => img.pixbuf, :angle_to_orig => 0 }
- if entry2type(origfile) == 'video'
- #- cleanup temp for videos
- system("rm -f #{current_dest_dir}/screenshot.jpg000000.jpg")
- end
pop_mousecursor
}
end
if !File.exists?(destvideo)
psys("cp '#{dir}/#{video}' '#{destvideo}'")
end
- #- cleanup temp
- system("rm -f #{dest_dir}/screenshot.jpg000000.jpg")
}
if !$forgui
html_index.gsub!(/~~image_iteration~~/, "<a href='thumbnails.html'>" + img_element(thumbnail) + '</a>')
html_index.gsub!(/~~caption_iteration~~/, xmldir.attributes['thumbnails-caption'])
end
- #- cleanup temp for videos
- system("rm -f #{dest_dir}/screenshot.jpg000000.jpg")
#- deal with sub-albums (direct to subdirs/index.html pages)
xmldir.elements.each('dir') { |child|
[ { 'filename' => thumbnail, 'size' => $albums_thumbnail_size } ], find_subalbum_info_type(child))
html_index.gsub!(/~~caption_iteration~~/, caption)
html_index.gsub!(/~~image_iteration~~/, "<a href='#{make_dest_filename(subdir)}/index.html'>" + img_element(thumbnail) + '</a>')
- #- cleanup temp for videos
- system("rm -f #{dest_dir}/screenshot.jpg000000.jpg")
}
html_index += close_iterations(iterations)
convert_options += ($config['convert-enhance'] || $convert_enhance) + " "
end
end
- orig_image = "#{dest_dir}/screenshot.jpg000000.jpg"
+ orig_image = "#{dest_dir}/#{File.basename(orig)}.jpg000000.jpg"
for dest in dests
if !File.exists?(orig_image)
transcode_options = ''
transcode_options += '-k '
end
end
- cmd = "transcode -a 0 -c #{frame_offset}-#{frame_offset+1} -i '#{orig}' -y jpg -o '#{dest_dir}/screenshot.jpg' #{transcode_options} 2>&1"
+ cmd = "transcode -a 0 -c #{frame_offset}-#{frame_offset+1} -i '#{orig}' -y jpg -o '#{dest_dir}/#{File.basename(orig)}.jpg' #{transcode_options} 2>&1"
msg 2, cmd
results = subproc_runaway_aware(cmd)
if results =~ /skipping frames/ && results =~ /encoded 0 frames/
msg 0, _("specified frame-offset too large? max frame was: %s. that may also be another problem. try another value.") %
results.scan(/skipping frames \[000000-(\d+)\]/)[-1]
return false
- elsif results =~ /V: import format.*unknown/ || !File.exists?("#{dest_dir}/screenshot.jpg000000.jpg")
+ elsif results =~ /V: import format.*unknown/ || !File.exists?(orig_image)
msg 2, _("* could not extract first image of video %s with transcode, will try first converting with mencoder") % orig
- cmd = "mencoder '#{orig}' -nosound -ovc lavc -lavcopts vcodec=mjpeg -o '#{dest_dir}/foo.avi' -frames #{frame_offset+1} -fps 25 >/dev/null 2>/dev/null"
+ cmd = "mencoder '#{orig}' -nosound -ovc lavc -lavcopts vcodec=mjpeg -o '#{dest_dir}/#{File.basename(orig)}.avi' -frames #{frame_offset+1} -fps 25 >/dev/null 2>/dev/null"
msg 2, cmd
system cmd
- if File.exists?("#{dest_dir}/foo.avi")
- cmd = "transcode -a 0 -c #{frame_offset}-#{frame_offset+1} -i '#{dest_dir}/foo.avi' -y jpg -o '#{dest_dir}/screenshot.jpg' #{transcode_options} 2>&1"
+ if File.exists?("#{dest_dir}/#{File.basename(orig)}.avi")
+ cmd = "transcode -a 0 -c #{frame_offset}-#{frame_offset+1} -i '#{dest_dir}/#{File.basename(orig)}.avi' -y jpg -o '#{dest_dir}/#{File.basename(orig)}.jpg' #{transcode_options} 2>&1"
msg 2, cmd
results = subproc_runaway_aware(cmd)
- system("rm -f '#{dest_dir}/foo.avi'")
+ system("rm -f '#{dest_dir}/#{File.basename(orig)}.avi'")
if results =~ /skipping frames/ && results =~ /encoded 0 frames/
msg 0, _("specified frame-offset too large? max frame was: %s. that may also be another probleme. try another value.") %
results.scan(/skipping frames \[000000-(\d+)\]/)[-1]
return false
- elsif results =~ /V: import format.*unknown/ || !File.exists?("#{dest_dir}/screenshot.jpg000000.jpg")
- msg 0, _("could not extract first image of video %s encoded by mencoder") % "#{dest_dir}/foo.avi"
+ elsif results =~ /V: import format.*unknown/ || !File.exists?(orig_image)
+ msg 0, _("could not extract first image of video %s encoded by mencoder") % "#{dest_dir}/#{File.basename(orig)}.avi"
return false
end
else