psys("cp '#{dir}/#{video}' '#{destvideo}'")
end
#- cleanup temp
- system("rm -f #{dest_dir}/screenshot.jpg00000*")
+ system("rm -f #{dest_dir}/screenshot.jpg000000.jpg")
}
#- fake for gettext to find these; if themes need more sizes, english name for them should be added here
html_index.gsub!(/~~caption_iteration~~/, xmldir.attributes['thumbnails-caption'])
end
#- cleanup temp for videos
- system("rm -f #{dest_dir}/screenshot.jpg00000*")
+ system("rm -f #{dest_dir}/screenshot.jpg000000.jpg")
#- deal with sub-albums (direct to subdirs/index.html pages)
xmldir.elements.each('dir') { |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.jpg00000*")
+ system("rm -f #{dest_dir}/screenshot.jpg000000.jpg")
}
html_index += close_iterations(iterations)
$rotated_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.jpg00000*")
+ system("rm -f #{current_dest_dir}/screenshot.jpg000000.jpg")
end
pop_mousecursor
}
xmldir.delete_attribute("#{infotype}-rotate")
xmldir.delete_attribute("#{infotype}-color-swap")
xmldir.delete_attribute("#{infotype}-enhance")
+ xmldir.delete_attribute("#{infotype}-frame-offset")
my_gen_real_thumbnail.call
end
fc.destroy
#- frame-offset is an attribute that allows to specify which frame to use for the thumbnail
frame_offset = felem.attributes["#{attributes_prefix}frame-offset"]
if !frame_offset
- felem.add_attribute("#{attributes_prefix}frame-offset", frame_offset = "5")
+ felem.add_attribute("#{attributes_prefix}frame-offset", frame_offset = "0")
end
frame_offset = frame_offset.to_i
if rotate = felem.attributes["#{attributes_prefix}rotate"]
end
end
for dest in dests
- if !File.exists?("#{dest_dir}/screenshot.jpg000004.jpg")
+ if !File.exists?("#{dest_dir}/screenshot.jpg000000.jpg")
transcode_options = ''
if felem
if felem.attributes["#{attributes_prefix}color-swap"]
transcode_options += '-k '
end
end
- cmd = "transcode -a 0 -c #{frame_offset-5}-#{frame_offset} -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}/screenshot.jpg' #{transcode_options} 2>&1"
msg 2, cmd
results = subproc_runaway_aware(cmd)
- if results =~ /skipping frames/ && results !~ /encoding frame/
- msg 0, _("specified frame-offset probably too large. max frame was: %s.") % results.scan(/skipping frames \[000000-(\d+)\]/)[-1]
+ 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.jpg000004.jpg")
+ elsif results =~ /V: import format.*unknown/ || !File.exists?("#{dest_dir}/screenshot.jpg000000.jpg")
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} -fps 25 >/dev/null 2>/dev/null"
+ 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"
msg 2, cmd
system cmd
if File.exists?("#{dest_dir}/foo.avi")
- cmd = "transcode -a 0 -c #{frame_offset-5}-#{frame_offset} -i '#{dest_dir}/foo.avi' -y jpg -o '#{dest_dir}/screenshot.jpg' #{transcode_options} 2>&1"
+ 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"
msg 2, cmd
results = subproc_runaway_aware(cmd)
system("rm -f '#{dest_dir}/foo.avi'")
- if results =~ /V: import format.*unknown/ || !File.exists?("#{dest_dir}/screenshot.jpg000004.jpg")
+ 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"
return false
end
end
end
- sys("#{$convert} #{convert_options}-size #{dest['size']} -resize #{dest['size']} #{dest_dir}/screenshot.jpg000004.jpg '#{dest['filename']}'")
+ sys("#{$convert} #{convert_options}-size #{dest['size']} -resize #{dest['size']} #{dest_dir}/screenshot.jpg000000.jpg '#{dest['filename']}'")
end
return true
end