Friendica photo import tool. This will bring in all your photos from the chosen Friendica account and import them into Red. Note that profile photos will also be imported, but will not be scaled for profiles, nor will they be attached to any profiles. They will appear however in your Profile Photos album. Photos that had any access restrictions in Friendica will be made private to only you. Comments and likes, captions, and tags are not transferred, only the actual photos. You will only be able to do this once. If something goes wrong but any photos were imported, a pconfig called frphotos.complete will be set and you'll have to remove it to start over. If you should remove this to start over, we also check each photo and will not over-write a photo you already brought over.

This commit is contained in:
friendica
2014-08-12 18:08:31 -07:00
parent 94ed44e76e
commit 50da5bd389
6 changed files with 171 additions and 7 deletions

View File

@@ -5,7 +5,7 @@ require_once('include/items.php');
require_once('include/photo/photo_driver.php');
function photo_upload($channel, $observer, $args, $local = null) {
function photo_upload($channel, $observer, $args) {
$ret = array('success' => false);
$channel_id = $channel['channel_id'];
@@ -62,17 +62,17 @@ function photo_upload($channel, $observer, $args, $local = null) {
$str_contact_deny = perms2str(((is_array($args['contact_deny'])) ? $args['contact_deny'] : explode(',',$args['contact_deny'])));
if($local) {
if($args['data']) {
// allow an import from a binary string representing the image.
// This bypasses the upload step and max size limit checking
$imagedata = $local;
$imagedata = $args['data'];
$filename = $args['filename'];
$filesize = strlen($imagedata);
// this is going to be deleted if it exists
$src = '/tmp/deletemenow';
$filetype = $args['filetype'];
$type = $args['type'];
}
else {
$f = array('src' => '', 'filename' => '', 'filesize' => 0, 'type' => '');
@@ -158,7 +158,7 @@ function photo_upload($channel, $observer, $args, $local = null) {
$smallest = 0;
$photo_hash = photo_new_resource();
$photo_hash = (($args['resource_id']) ? $args['resource_id'] : photo_new_resource());
$visitor = '';
if($channel['channel_hash'] !== $observer['xchan_hash'])