Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erro ao criar thumbnail de imagem SVG no otimizador de XMLs #227

Closed
patymori opened this issue Apr 13, 2020 · 0 comments
Closed

Erro ao criar thumbnail de imagem SVG no otimizador de XMLs #227

patymori opened this issue Apr 13, 2020 · 0 comments
Assignees
Labels

Comments

@patymori
Copy link
Contributor

Descrição do problema

Ao utilizar o otimizador de XMLs com ativos digitais em SVG, não é possível criar thumbnails pois o Pillow, por si só, ainda não oferece suporte ao formato. O seguinte erro ocorreu:

Traceback (most recent call last):
  ...
    optimised_xml = xml_web_optimiser.get_xml_file()
  File "/../packtools/packtools/utils.py", line 631, in get_xml_file
    image_filename, self._add_assets_thumbnails
  File "/../packtools/packtools/utils.py", line 595, in _get_optimised_image_with_filename
    return add_image(image_filename)
  File "/../packtools/packtools/utils.py", line 562, in _add_assets_thumbnails
    web_image_generator = self._get_web_image_generator(image_filename)
  File "/../packtools/packtools/utils.py", line 544, in _get_web_image_generator
    image_filename, self.work_dir, image_file_bytes
  File "/../packtools/packtools/utils.py", line 309, in __init__
    self._image_object = self._get_image_object(file_bytes)
  File "/../packtools/packtools/utils.py", line 319, in _get_image_object
    'Error reading image "%s": %s' % (self.filename, str(exc))
packtools.exceptions.WebImageGeneratorError: Error reading image "2175-7968-ct-37-3-0092-e02.svg": cannot parse this image

Existe um ticket aberto no projeto com a funcionalidade: python-pillow/Pillow#3509.

Passos para reproduzir o problema

  1. Utilize o comando package_optimiser com um pacote contendo documento que referencie ativos digitais em format SVG e os arquivos SVG. Ex: ct/v37n3
  2. Observe o erro reportado

Comportamento esperado

O otimizador de XMLs deve prever que possam existir problemas na leitura de arquivos de imagens e tratar conforme o parâmetro stop_if_error.

Screenshots ou vídeos

n/a

Anexos

n/a

Ambiente utilizado

Erro detectado durante a utilização da aplicação https://github.com/scieloorg/document-store-migracao

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant