* (2016-03-22) Make a method (in chunkymap.php) to echo the map as an html5 canvas
* (2016-03-22) Make a method (in chunkymap.php) to echo the map as an html5 canvas
## Developer Notes:
## Developer Notes:
* minetestinfo.py's Chunk set_from_genresult expects the following lines (such as from minetestmapper.py or minetestmapper-numpy.py):
Result image (w=512 h=3152) will be written to C:\Users\jgustafson\Documents\GitHub\minetest-chunkymap\chunkymap-genresults\Enliven20170213v7\singleimage.png
Drawing image
Saving to: C:\Users\jgustafson\Documents\GitHub\minetest-chunkymap\chunkymap-genresults\Enliven20170213v7\singleimage.png
('PNG Region: ', [-208, 304, -688, 2464])
('pngMinX: ', '-208')
('pngMaxZ: ', '2464')
('Pixels PerNode: ', 1)
('border: ', 0)
where PNG Region values are left,right,top,bottom respectively.
where required values are Result image dimensions, and PNG Region or xmin,xmax,zmin,zmax.
* Player username privacy: check_players in generator.py intentionally makes up an index and uses that as the filename on the destination, so that ajax can update players without knowing either their id (filename of minetest player file) or display name (listed in the player file)
* Player username privacy: check_players in generator.py intentionally makes up an index and uses that as the filename on the destination, so that ajax can update players without knowing either their id (filename of minetest player file) or display name (listed in the player file)
(this way, only usernames can be known if chunkymap.php allows that, or the person is logged in to the server)
(this way, only usernames can be known if chunkymap.php allows that, or the person is logged in to the server)
Because of the feature, generator.py must prevent duplicates based on value of id in the resulting yml files (minetest player filename as id).
Because of the feature, generator.py must prevent duplicates based on value of id in the resulting yml files (minetest player filename as id).
print("Unable to get stat on www directory \""+minetestinfo.get_var("www_minetest_path")+"\", so will not be able to automatically set owner of result jpg there. Make sure you manually set owner of singleimage.jpg in '"+www_chunkymapdata_world_path+"' to www_data user and group.")
print(""+str(sys.exc_info()))
is_locked=False
is_locked=False
err_count=0
err_count=0
@ -177,6 +195,7 @@ class ChunkymapOfflineRenderer:
#this_move_cmd_string = move_cmd_string+" \""+tmp_png_path+"\" to \""+dest_png_path+"\"..."
#this_move_cmd_string = move_cmd_string+" \""+tmp_png_path+"\" to \""+dest_png_path+"\"..."
shutil.move(tmp_png_path,dest_png_path)#avoids error below according to
shutil.move(tmp_png_path,dest_png_path)#avoids error below according to
# os.rename(tmp_png_path, dest_png_path) # fails with the following output:
# os.rename(tmp_png_path, dest_png_path) # fails with the following output:
# Moving temp image from /home/owner/chunkymap/chunkymap-genresults/FCAGameAWorld/singleimage.png to /var/www/html/minetest/chunkymapdata/worlds/FCAGameAWorld/singleimage.png...
# Moving temp image from /home/owner/chunkymap/chunkymap-genresults/FCAGameAWorld/singleimage.png to /var/www/html/minetest/chunkymapdata/worlds/FCAGameAWorld/singleimage.png...
# Traceback (most recent call last):
# Traceback (most recent call last):
@ -206,6 +225,9 @@ class ChunkymapOfflineRenderer: