access to virtual keyboard - page 2 - General Discussion and Assistance - CHDK Forum

access to virtual keyboard

  • 13 Replies
  • 3524 Views
*

Offline msl

  • *****
  • 1267
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: access to virtual keyboard
« Reply #10 on: 07 / July / 2012, 13:20:45 »
Advertisements
A script is the better way to do this job. With a script you can call the CHDK file browser and select a file for renaming. Here is a simple example for the renaming of a file suffix:
Code: [Select]
--[[
@title renaming
]]

new_suffix = "jpg"
file = file_browser("A/DCIM")
file_new = string.sub(file, 1, (string.len(file)-3)) .. new_suffix
print("new:", file_new)
os.rename(file, file_new)

You can use the review mode for such actions.

msl
CHDK-DE:  CHDK-DE links

Re: access to virtual keyboard
« Reply #11 on: 11 / July / 2012, 10:51:54 »
Again, my thanks.  This script enabled me to shoot video, then convert its suffix to jpg.  The eye-fi app on my Playbook accepted the file via wi-fi and passed it on to my laptop via wi-fi.
 To get it to flickr I can then either attach it to an e-mail if it is under 8.2 meg or upload it with the the new flickr uploader on the flickr site.
Flickr will rename it as video.
Or I can rename it on my laptop.

Eye-fi will not selectively upload to flickr these video files that are labelled as jpg.  It will selectively upload to flickr true jpegs.

Raw files with a suffix of jpg thanks to CHDK can also with eye-fi move among my camera, Playbook and laptop.
but flickr rejects the format.

Both these renamed raw and avi files do appear on EYE-Fi view on the net with the jpg suffix.  But they will not automatically go to flickr.

But thanks to CHDK I can with a first generation eye-fi card move video and raw from my camera to my Playbook and laptop via wi-fi.

When it was only designed to move jpegs.

*

Offline srsa_4c

  • ******
  • 4150
Re: access to virtual keyboard
« Reply #12 on: 11 / July / 2012, 12:22:42 »
Just an idea. Maybe a script is more suited to do this kind of job. Something like: create a list of all movie files on the card -> change their extensions to jpg.
Code: [Select]
--[[
  @title Rename avi files to jpg

  Original code: disk.lua, http://chdk.setepontos.com/index.php?topic=2902.0
  Original author: fudgey 2008/10/27
  Licence: GPL v3 or higher
--]]

disk = {}

-- returns list of files that contain the provided search string
function disk.filterImageFiles(searchString)
local imageList = disk.getImageList()
local count = table.getn(imageList)
local i = 0
while i ~= count do
i = i + 1
if(string.find(imageList[i],searchString,17, true) == nil) then
table.remove(imageList,i)
i = i - 1
count = count - 1
end
end
return imageList
end

--[[ Loops through directories within DCIM dir, checks to see
that each directory contains images. returns list of directories.
deletes empty directories
]]
function disk.getImageDirectories()
local imgTable = {}
--get directories that may contain images
local dcimList = os.listdir("A/DCIM", false)
if(dcimList) then
local dirCount = table.getn(dcimList)
table.sort(dcimList)
--loop through directories
local i = 0
while ( dirCount ~= i) do
i = i + 1
--get file list
local imgDirList = os.listdir("A/DCIM/"..dcimList[i], false)
if(imgDirList) then
local imgCount = table.getn(imgDirList)
table.sort(imgDirList)
if(imgCount == nil) then
os.remove("A/DCIM/"..dcimList[i])
table.remove(dcimList,i)
end
else
os.remove("A/DCIM/"..dcimList[i])
table.remove(dcimList,itemCount)
end
end
end

--log.print("-end- getImageDirectories ")
return dcimList
end

--[[ Loops through DCIM dirs and creates list of files ]]
function disk.getImageList()
local imgTable = {}
local dcimList = disk.getImageDirectories()
local dirCount = table.getn(dcimList)
local i = 0
while ( dirCount ~= i) do
i = i + 1
--log.print("A/DCIM/"..dcimList[i].."\n")
local imgDirList = os.listdir("A/DCIM/"..dcimList[i], false)
local imgCount = table.getn(imgDirList)
--log.print("imgCount:"..imgCount)
table.sort(imgDirList)
local a = 0
while (imgCount ~= a) do
a = a + 1
--log.print("A/DCIM/"..dcimList[i].."/"..imgDirList[a])
table.insert(imgTable,"A/DCIM/"..dcimList[i].."/"..imgDirList[a])
end
end
return imgTable
end

--[[
Mass rename of movie files to .JPG, thumbnails are not touched.
Takes advantage of the fact that movie files are usually significantly larger than images, and their full filenames will usually fit into a moderate amount of RAM.
]]
newPicList = disk.filterImageFiles(".AVI")
for index,oldName in ipairs(newPicList) do
  namepart = string.sub(oldName,1,24)
  os.rename(oldName,namepart..".JPG")
end
The code assumes a file structure for camera files like this:
A/DCIM/xxxCANON/MVI_xxxx.AVI
If the length of file or folder names are different, the script will not work correctly.

I tried this on a small card with an A470, it managed to rename the two .AVIs :)

Before you start using it on a camera that has not been tested for this, make a backup of your card's contents, and try this script in play mode. BTW, always run this in play mode.

Re: access to virtual keyboard
« Reply #13 on: 25 / August / 2012, 12:58:54 »
The above code until today worked fine.  In ALT mode in play set up on my A540 I would click the shutter which took me to the directory.  In the directory I pushed the func/set button when the desired avi was highlighted.  I was taken to the original video still screen with text saying started and finished and stating that the avi was now a jpeg.

But in the directory, the avi still has avi as the suffix.

Might i have accidentally altered a script setting in chdk or some other setting that would change the script functioning?


 

Related Topics