簡體   English   中英

在Facebook中上傳/標記照片時,PhotosDuplicateTagInBatch錯誤!

[英]PhotosDuplicateTagInBatch error when uploading / tagging photos in Facebook!

我正在編寫一個應用程序,該應用程序允許用戶一次將多張照片上傳到Facebook,並在發生這種情況時自動在照片中標記自己(無其他人)。

如果我運行腳本一次,則運行良好,如果我嘗試上傳並標記多張照片,則該PhotosDuplicateTagInBatch出現PhotosDuplicateTagInBatch錯誤,並且找不到任何有關此情況的信息!

這是我的代碼:

  for ($i = 5; $i >= 1; $i--)
  {
        $img = GetImage($i);
        $tag = array(
            'tag_uid' => $facebook->getUser(),
            'x' => rand (0,100),
            'y' => rand (0,100)
        );
        $tags[] = json_encode($tag);
        $args = array(
          'message' => $i,
          'image' => '@'.realpath($img),
          'tags' => $tags,
        );

        $data = $facebook->api('/me/photos', 'post', $args);
    }

}

如果我輸出參數,它們將顯示為:代碼:

Array
(
    [message] =>  4
    [image] => @imagepathhere
    [tags] => Array
        (
            [0] => {"tag_uid":"100002493436028","x":13,"y":68}
            [1] => {"tag_uid":"100002493436028","x":60,"y":57}
        )

)

所以從本質上講,據我所知,您不能像這樣上傳和標記多張照片。 我要做的就是上傳照片,然后分別標記並沖洗並重復

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM