LukeSkywalker92 / TeleFrame

TeleFrame - a digital picture frame for telegram
MIT License
92 stars 28 forks source link

Feature/zoom crop images #130

Closed call-me-matt closed 3 years ago

call-me-matt commented 4 years ago

Adding an option to crop and zoom pictures so that no borders are shown if image ratio does not match the screen ratio.

tommy86geis commented 4 years ago

Is it already finished? how can i Update? i already have black boarders

call-me-matt commented 4 years ago

Hi. Yes, it was a very simple change (only implemented for pictures, not for videos). Until it is merged, you can pull from my repository (https://github.com/call-me-matt/TeleFrame/tree/feature/zoom-crop-images). In the config, you have to add the cropZoomImages and set it to true. I would love to have some feedback, here it is working fine.

tommy86geis commented 4 years ago

Hello, thankyou for your fast respone. i added the config cropZoomImages and set it to true. I habe a problem, how can i install your respositoy? Sorry i am not very good in linux programming.

pi@raspberrypi:~ $ cd ~/TeleFrame/addons pi@raspberrypi:~/TeleFrame/addons $ git clone https://github.com/call-me-matt/Te leFrame/tree/feature/zoom-crop-images Cloning into 'zoom-crop-images'... fatal: repository 'https://github.com/call-me-matt/TeleFrame/tree/feature/zoom-c rop-images/' not found

call-me-matt commented 4 years ago

You are right, my description was not the best. You have to clone the repository with git clone https://github.com/call-me-matt/TeleFrame.git, then change into the TeleFrame directory and execute git checkout feature/zoom-crop-images. To verify if everything went well, you can check if the README now lists the cropZoomImages.

tommy86geis commented 4 years ago

Sorry, maybe i am to stupit :-) git clone https://github.com/call-me-matt/TeleFrame.git is running perfectly cd TeleFrame works also pi@raspberrypi:~/TeleFrame $

git checkout feature/zoom-crop-images gets an error error: pathspec 'feature/zoom-crop-images' did not match any file(s) known to git

lsbring this result

pi@raspberrypi:~/TeleFrame $ ls addons config fonts js node_modules README.md tools audiofiles core images LICENSE package.json sounds botonly.js css index.html main.js package-lock.json splashscreen

call-me-matt commented 4 years ago

Should have worked like that, I just tried it on my computer. which version of git do you have?

tommy86geis commented 4 years ago

pi@raspberrypi:~/TeleFrame $ git --version git version 2.20.1

pi@raspberrypi:~/TeleFrame $ sudo apt install git Reading package lists... Done Building dependency tree Reading state information... Done git is already the newest version (1:2.20.1-2+deb10u3). The following package was automatically installed and is no longer required: rpi-eeprom-images Use 'sudo apt autoremove' to remove it. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

call-me-matt commented 4 years ago

could you post the content of cat .git/config

tommy86geis commented 4 years ago

pi@raspberrypi:~/TeleFrame $ cat .git/config [core] repositoryformatversion = 0 filemode = false bare = false logallrefupdates = true [remote "origin"] url = https://github.com/LukeSkywalker92/TeleFrame.git fetch = +refs/heads/master:refs/remotes/origin/master [branch "master"] remote = origin merge = refs/heads/master

call-me-matt commented 4 years ago

so, this points still to this git. the clone must have failed, because a TeleFrame directory existed. rename that one and retry

tommy86geis commented 4 years ago

pi@raspberrypi:~/TeleFrame $ cd pi@raspberrypi:~ $ mv TeleFrame TeleFrame OLD mv: target 'OLD' is not a directory pi@raspberrypi:~ $ mv TeleFrame TeleFrameOLD pi@raspberrypi:~ $ ls Bookshelf Documents Music Public Templates Videos Desktop Downloads Pictures TeleFrameOLD thinclient_drives pi@raspberrypi:~ $ git clone https://github.com/call-me-matt/TeleFrame.git Cloning into 'TeleFrame'... remote: Enumerating objects: 194, done. remote: Counting objects: 100% (194/194), done. remote: Compressing objects: 100% (124/124), done. remote: Total 1984 (delta 108), reused 133 (delta 69), pack-reused 1790 Receiving objects: 100% (1984/1984), 14.06 MiB | 1.75 MiB/s, done. Resolving deltas: 100% (1238/1238), done. pi@raspberrypi:~ $ cd TeleFrame pi@raspberrypi:~/TeleFrame $ git checkout feature/zoom-crop-image error: pathspec 'feature/zoom-crop-image' did not match any file(s) known to git pi@raspberrypi:~/TeleFrame $ cd pi@raspberrypi:~ $ git checkout feature/zoom-crop-image fatal: not a git repository (or any of the parent directories): .git pi@raspberrypi:~ $ ls Bookshelf Documents Music Public TeleFrameOLD thinclient_drives Desktop Downloads Pictures TeleFrame Templates Videos pi@raspberrypi:~ $

there is also the old README.md without CropZoom Option | Description $ | -------------------- | ---------------------------------------------------------------------------------$ | botToken | The token of the Telegram Bot, which will recieve the images. How to create a bot$ | whitelistChats | Use this to only allow certain users to send photos to your TeleFrame. See hints $ | whitelistAdmins | Use this to increase individual users as admin. $ | screenConfig | Defines the configuration file of your screen, see folder TeleFrame/config/screen$ | playSoundOnRecieve | Play a sound on recieving a message, set false to turn off. $ | showVideos | When set to true, videos that are send to the bot are also shown. $ | playVideoAudio | If recieved videos should be played with sound or not. $ | imageFolder | The folder where the images are stored. $ | fullscreen | When set to true, TeleFrame will run in fullscreen mode. $ | fadeTime | The fading time between two images. $ | interval | The time that an image is shown. $ | imageCount | Defines how many different images are shown in the slideshow. $ | autoDeleteImages | Defines if old images should be deleted, when they are no longer used in the slid$ | showSender | When set to true, TeleFrame will show the name of the sender when the image is sh$ | showCaption | When set to true, TeleFrame will show the caption of the image when the image is $ | fullscreen | When set to true, TeleFrame will run in fullscreen mode. $ | toggleMonitor | When set to true, TeleFrame will switch the monitor off and on at the defined hou$ | turnOnHour | Defines when the monitor should be turned on. $ | turnOffHour | Defines when the monitor should be turned off. $ | switchLedsOff | Defines if the 2 LEDs on the RaspberryPi should be switched off. $ | botReply | Defines if the bot should answer on images or videos with a short reply (:+1: :ca$ | confirmDeleteImage | Defines if to show a confirm message before delete an image true or false $ | confirmShutdown | Defines if to show a confirm message before shutdown the system true or false$ | confirmReboot | Defines if to show a confirm message before rebooting the system true or false$ |keys` | Defines an object with 4 strings specifying the keyboard shortcuts for play, next$

call-me-matt commented 4 years ago

just a tiny typo: git checkout feature/zoom-crop-images

tommy86geis commented 3 years ago

sorry, i don't get it work. i installed the frame original from the lukeSkywalker git install page how can i install your call me mat git? should i new install the frame with your git or can i update the luke git? can you send a step by step for install? thankyou

call-me-matt commented 3 years ago

There should be no difference, but instead of cloning https://github.com/LukeSkywalker92/TeleFrame.git, you have to take https://github.com/call-me-matt/TeleFrame.git and do a git checkout feature/zoom-crop-images afterwards. The rest is identical and you can use the installation guide you have already. ~Normally no reinstall is required, though.~

tommy86geis commented 3 years ago

mv TeleFrame TeleFrameOrg git clone https://github.com/call-me-matt/TeleFrame.git cd TeleFrame git checkout feature/zoom-crop-images

this will run without problems

if i resatart the frame then it woll not run. so i made a mv TeleFrame TeleFrameMatt the old version will run again

so the git is correct for the original Version

pi@raspberrypi:~ $ cd TeleFrame pi@raspberrypi:~/TeleFrame $ cat .git/config [core] repositoryformatversion = 0 filemode = false bare = false logallrefupdates = true [remote "origin"] url = https://github.com/LukeSkywalker92/TeleFrame.git fetch = +refs/heads/master:refs/remotes/origin/master [branch "master"] remote = origin merge = refs/heads/master

your Git pi@raspberrypi:~ $ cd TeleFrameMatt pi@raspberrypi:~/TeleFrameMatt $ cat .git/config [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote "origin"] url = https://github.com/call-me-matt/TeleFrame.git fetch = +refs/heads/:refs/remotes/origin/ [branch "master"] remote = origin merge = refs/heads/master [branch "feature/zoom-crop-images"] remote = origin merge = refs/heads/feature/zoom-crop-images

is also the right git.

is it possible to copy the Original Folder and change the git?

call-me-matt commented 3 years ago

ok, then you have to do the install again. Do everything identically to before, but replace the git clone-command with the two commands from above.

call-me-matt commented 3 years ago

If it is too complicated, you can see the changes I made here: https://github.com/LukeSkywalker92/TeleFrame/pull/130/commits/5fd0df63efe95236e5655e33501ec85ffa8ff4e1 - it's only a few, you can do the same on your code in a few minutes.

tommy86geis commented 3 years ago

oh nice, i do it manually and it work really fine!!! maybe is it possible to change the code in the main code? this is really good

call-me-matt commented 3 years ago

I'm glad you like it! It's up to @LukeSkywalker92 to accept the pull request, I have prepared everything to have it integrated. fingers crossed