Berlin, Germany
Read the statement by Michael Teeuw here.
Posts
-
RE: Iframe Module for Webcam
Ok , i have build my own now - i am not really a javescript programmer - pls dont laugh!!!
i have the following code, how can i initiate the the startonload() function ist run. if i write this in dom, there will be run, but not shiow the wrapper…
/* global Module */ /* Magic Mirror * Module: MMM-iFrame * * By Michael Teeuw http://michaelteeuw.nl * MIT Licensed. */ Module.register("MMM-iFrame",{ // Default module config. defaults: { animationSpeed: 1000, }, preload: function() { this.img.src='http://guest@192.168.188.65/tmpfs/auto.jpg?'+new Date; }, changesrc: function() { img1.src=img.src; this.preload(); setTimeout(changesrc,3500); }, update: function() { var imgObj = document.getElementById('img1'); imgObj.src = this.img.src; this.img.src = "http://guest@192.168.188.65/tmpfs/auto.jpg?" + (new Date()).getTime(); }, takeerror: function() { this.img.src = "http://guest@192.168.188.65/tmpfs/auto.jpg?" + (new Date()).getTime(); }, startonload: function() { this.img.src = "http://guest@192.168.188.65/tmpfs/auto.jpg?" + (new Date()).getTime(); this.img.onerror=this.takeerror(); this.img.onload=this.update(); }, load: function() { if (navigator.appName.indexOf("Microsoft IE Mobile") != -1) { this.preload(); this.changesrc(); return; } this.startonload(); }, start: function() { Log.info('Starting module: ' + this.name); var self = this; var imgObj = ""; var img = new Image(); this.img = new Image(); this.imgObj; setInterval(function() { self.updateDom(); }, this.config.animationSpeed); }, // Override dom generator. getDom: function() { var wrapper = document.createElement("div"); var imagewrapper = document.createElement("iFrame"); imagewrapper.style = "border:0" imagewrapper.width = 0; imagewrapper.height = 0; imagewrapper.src = "http://guest@192.168.188.65/tmpfs/auto.jpg"; wrapper.innerHTML = "<img class="center-ver3" src="http://guest@192.168.188.65/tmpfs/auto.jpg" />"; wrapper.appendChild(imagewrapper); return wrapper; } });
(The iFrame is not visible, it is just for open a Browser session with a user without a password)
Can anyone help me by my probem?
thx
-
Get pictures from synology NAS - "Rediscover This Day"
Hey,
is anyone here who is needing a solution to show own images from the past years? Like the Facebook remember function? The job to sort the images runs on the synology and works with: mysql, exiv2 and copy. I get the Exif data from each image and write it in a sqldb. with bash i get the files in a local folder (incl. resize for the mirror). The raspberry is copy the images in a local folder. Here dit i use the MMM-ImagesPhoto Plugin.
my solution ist very simple and usable with the latest synology firmware. If anyone want read this, in wich category can i post it?!
Not the right resolution, but you can see the what i mean… -
RE: Get pictures from synology NAS - "Rediscover This Day"
Hello,
i help me here very simple. on the Magicmirror side, i have a cronjob what get pictures every day per ssh/scp. To use this, i have add the magicmirror device to the knownhosts on the synology side (google for it).
on Synology side:
This Script is get the exif data of the images. write it to a CSV and then, get the path and write it to a mysqldb (This Script i run once every year one time per hand … i dont know it works perfectly… I think, that here are better coding people… this is quick and dirty. But it works for me. I cant show the Magicmirror side now, i am not at home - but you can use every Plugin with a upload folder… i can show my “Plugin” in the next days if you want…#!/bin/bash # # This script is get the exif data (if set) from all # pictures (jpg/JPG) in a define path (recursiv). # It writes the data to am MYSQL Database. # # It works native with Synology DSM (Tested with 6.0.2-xxxx) # # To use this script, put in the root folder of your photos # chmod 775 ./listimages.sh make the script executable # ./listimages.sh execute the scriptfile # # Where want you present your files? imagepath=/volume1/Intern/Fotos/MagicMirror/ # Variables for the temp files (will delete at End of the Script exportcsv=./export.csv importcsv=./import.csv # MySql Data username=root password=PASSWORD database=ExifData table=Bilder shopt -s globstar extglob exiv2 -pa -g DateTimeOriginal **/*.@(jpg|JPG) | awk -v pwd="$PWD/" -v dq='"' -v OFS=',' '{ fn = substr($0, 1, match($0, / *Exif\.Photo/)-1) print dq pwd fn dq, dq $(NF-1) dq, dq $NF dq }' >$exportcsv mysql -u$username -p$password -e "use $database" -e " TRUNCATE Bilder;" # Write data to mysql for f in $exportcsv do mysql -u$username -p$password -e "use $database" -e " LOAD DATA LOCAL INFILE '$f' INTO TABLE $table FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\n' (path,date,time);" done
This script is copying and resizing the images:
importcsv=/volume1/Intern/Fotos/Bilder/import.csv imagepath=/volume1/Intern/Fotos/MagicMirror/ #remove old images rm /volume1/Intern/Fotos/Bilder/import.csv rm /volume1/Intern/Fotos/MagicMirror/*.* #Get Date from tommorow DATE=$(date --date='1 day' +%m-%d) #DATE=$(date +%m-%d) #MYSQL Query by date from tomorrow id=$(mysql -uroot -pPASSWORD -s -N -e "SELECT path FROM ExifData.Bilder WHERE date like '%$DATE' INTO OUTFILE '$importcsv' FIELDS TERMINATED BY ',' ENCLOSED BY ''") # Copy files with exifdata from tomorow before one,two, three or whatever years while read p; do cp "$p" $imagepath done < $importcsv #(DELETE THE SPACE BETWEEN < AND $!!!!) cd $imagepath shopt -s nullglob i=0 for f in *.JPG *.jpg *.jpeg; do exiv2 -r "$i"_%d.%m.%Y_%H.%M.%S rename ./"$f" i=$((i+1)) done for f in *.JPG *.jpg *.jpeg; do convert -thumbnail 800 ./"$f" ./"${f%}.jpg" rm ./"$f" done
I hope this helps - you can do it! Have fun!