Improved messages

This commit is contained in:
Michael 2022-05-24 17:33:10 +00:00
parent f16cb13dc7
commit f764ab7429
2 changed files with 13 additions and 13 deletions

View file

@ -89,26 +89,26 @@ HELP;
echo ++$count . '/' . $total . "\t" . $contact['id'] . "\t" . $contact['url'] . "\t";
$resourceid = Photo::ridFromURI($contact['photo']);
if (empty($resourceid)) {
echo $this->l10n->t('no resource') . "\n";
echo $this->l10n->t('no resource in photo %1', $contact['photo']) . "\n";
continue;
}
echo '1';
$photo = Photo::selectFirst([], ['resource-id' => $resourceid], ['order' => ['scale']]);
if (empty($photo)) {
echo $this->l10n->t('no photo') . "\n";
echo $this->l10n->t('no photo with id %1', $resourceid) . "\n";
continue;
}
echo '2';
$imgdata = Photo::getImageDataForPhoto($photo);
if (empty($imgdata)) {
echo $this->l10n->t('no image data') . "\n";
echo $this->l10n->t('no image data for photo with id %1', $resourceid) . "\n";
continue;
}
echo '3';
$image = new Image($imgdata, Images::getMimeTypeByData($imgdata));
if (!$image->isValid()) {
echo $this->l10n->t('invalid image') . "\n";
echo $this->l10n->t('invalid image for id %1', $resourceid) . "\n";
continue;
}