Терминал: переименуйте несколько файлов JPG в формат HEIC с условием

Estaba experimentando el mismo problema Error :Las listas de archivos de tipos de datos solicitados no están disponibles . Seguí el proceso @slm anterior para reducir qué archivo.repo estaba causando el problema, pero ahora, ¿qué repositorio individual?

Cambié enable=1 en todos los repositorios individuales dentro del archivo.repo a 0 y luego probé el comando de lista después de habilitar cada repositorio individual. Eventualmente encontré el repositorio individual que causaba el problema.

Alojamos caché de repositorio con Artifactory... pero incluso con repositorios alojados externamente, si puede navegar por los repositorios (como http://mirror.centos.org/centos/7.5.1804/os/x86_64/repodata/), verá filelist.xml.gz,este es el archivo faltante del que habla el error.

Para Artifactory, encontré :https://www.jfrog.com/confluence/display/RTF/RPM+Repositories

Indexing the File List 
The filelists.xml metadata file of an RPM repository contains a list of all
the files in each package hosted in the repository. When the repository
contains many packages, reindexing this file as a result of interactions
with the YUM client can be resource intensive causing a degradation of
performance. Therefore, from version 5.4, reindexing this file is initially
disabled when an RPM repository is created. To enable indexing
filelists.xml, set the Enable File List Indexing checkbox.

Así que pude navegar a Admin -> local -> "repo" y marcar la casilla para crear la lista de archivos.

Después de esto, limpié el caché:

$ yum clean all

$ rm -rf /var/cache/yum

y volver a ejecutar

$ yum list iostat

y resolvió mi problema.

1
06.02.2019, 13:54
1 ответ

Если у вас есть программа командной строки, которая может открывать файлы JPG, но не HEIC, вы можете запустить эту программу и использовать ее код выхода, чтобы определить, является ли файл допустимым JPG или нет.

Вы можете попробовать программу convertот imagemagick.

непроверенный пример:

for jpg in *.jpg
do
    heic="${jpg%.jpg}.heic"    # construct HEIC file name
    tmp="$jpg.png"             # temporary PNG file
    if ! convert "$jpg" "$tmp" # try to convert
    then
        mv "$jpg" "$heic"      # rename if conversion failed
    fi
    rm -f "$tmp"               # PNG no longer needed
done

Конечно, это не работает, если программа convertпринимает файлы HEIC в качестве входных данных.

Пример кода был вдохновлен этим:https://github.com/williamthing/Scripts/blob/master/Shell/jpg2png.sh

0
28.04.2021, 23:37

Теги

Похожие вопросы