Closed jens-maus closed 8 years ago
@holzhannes
Now that I have merged all your changes I have some question regarding the init-images change. What is this all about and why have you changed carddav2fb to upload numbered images rather than Lastname_Firstname.jpg
? I don't really get the idea why this change might be required. And why is pre-uploading of init images required somehow? In addition, I have the feeling that having numbered images rather than named images is rather confusing and might lead to two images having the same content as soon as one contact is deleted or removed and the indexed number being reused on the next run of carddav2fb. Please clarify.
@jens-maus First of all, sorry for not sending pull requests!
I have many FRITZ!Boxes (FB) of my family and they are all connected by VPN for secure internal phone calls. My FB is connected to a raspberry pi which is running carddav2fb and pushing all the phone books of my family members to their FBs.
I don't exactly know which contact(s) has an Image and which contact(s) not, and I don't like to think which images have to be uploaded to the FBs because these are two many even for my own 300 contacts, therefore having init-images on every FB and just overwriting them with the real images seems to be a good solution for me. Without the init-images I have to do too many manual steps. With images in the format Lastname_Firstname.jpg
I need to upload them manual once before. For 15 Images that would be OK but for 300 Images every week it is too much.
This is not needed with the init-images. Of course it may happen that there are some duplicates but the FB will not care about that, because it will only show the once referenced in the phone book xml file.
In short I am solving the issue to think which images have to be uploaded to the FB the first time in case a image is added to a contact. I hope I could clarify. In case no initial manual upload to the FB would be needed I would of course prefer the format Lastname_Firstname.jpg
.
@holzhannes i Think when you have multiple Phonebook inside of the FritzBox, it will be Better so use Lastname_Firstname.jpg. When Possible use Subfolder for each Phonebook.
@holzhannes / cc @jens-maus
Because i'm syncing to CardDav-Accounts to 2 different Phonebooks. And With your Commit @holzhannes Picture Nr.7 of my Wife will me overwritten with my Picture Nr. 7.
Can you Tell me where/how i change (or change it in a new commit) to Change the Name of the Pictures like "Lastname_Firstname_PhonebookName.jpg". I Think this will me the best way for all people :)
@ArnaudFeld Just some seconds I will find a solution. I understand your problem!
@holzhannes thanks a lot (and the next commit ;-) )
BTW: Thanks to @jens-maus & @holzhannes for your work :)
I fixed it with a config option, if the config option is not set the Lastname_Firstname filenames will be used. #17
@ArnaudFeld If you like to fix it by your own back to the previous version just add the lines with + in our carddav2fb.php file (around line 242) and remove or comment the lines with -.
// format filename of contact photo; remove special letters
if ($vcard_obj->photo) {
+ $photo = str_replace(array(',','&',' ','/','ä','ö','ü','Ä','Ö','Ü','ß','á','à','ó','ò','ú','ù','í'),
+ array('','_','_','_','ae','oe','ue','Ae','Oe','Ue','ss','a','a','o','o','u','u','i'),$name);
- $photo = $imgseqfname;
- $imgseqfname++;
}
@jens-maus the last days I was thinking a lot about my init-images and why you where wondering so much ;-) Today I came to the conclusion that my "feature" is not needed because I was always working with the internal storage of the FritzBox but in case you are using a USB-Storage uploading the .jpgs via FTP is no Problem (with the internal storage of the FritzBox uploading images which are non existing is not possible) therefore the init-images are not realy need because using an USB-Storage is much more confined. Don`t worry I will rebuild it the next weeks, and will also write some lines about this into the readme file.
This is a request to merge all changes between holzhannes/carddav2fb fork and jens-maus/carddav2fb.
@holzhannes: In future, please make sure to send pull requests along my way rather than continuing your fork.