unfoldingWord-dev / ts-desktop

translationStudio Desktop App
http://ufw.io/ts
Other
41 stars 29 forks source link

OBS Images Don't Download Correctly #1212

Open mondele opened 6 years ago

mondele commented 6 years ago

This is a difficult issue, because it seems like it doesn't affect all copies of translationStudio. Using translationStudio Desktop 11.1 build 132 I have one machine (Mac OS X 10.11 El Capitan) that cannot download the images for printing OBS. reporter.js:120 2017-12-06 10:39:47 E/ts-dashboard.html:1077:3: Download Failed Invalid or unsupported zip format. No END header found On a second machine, same version of translationStudio and MacOS 10.12 Sierra, it notifies me that images are being downloaded and subsequently downloads them.

Other users are also experiencing this issue.

mondele commented 6 years ago

Update. Navigating to ~/Library/Application Support/translationstudio/images I can delete the ons-images.zip file (initially 0 bytes) and then translationStudio will download a fresh copy of the images. However, printing the OBS results in broken-link type image placeholders in the preview, and no images in the PDF produced. Quitting translationStudio and relaunching does not download new copies, nor does it correct the problem.

mondele commented 6 years ago

Consulting the log in translationStudio, it is looking for files with name ~/Library/Application%20Support/translationstudio/images/obs-en-_nn_nn_.jpg. The actual files omit the en portion of the name.

mondele commented 6 years ago

Putting the images from this archive: https://drive.google.com/open?id=1Nu-Q5WiKPkZPVfXBlAks_sUpyJElFb9i into the translationstudio/images/obs/ folder solves this problem. Is it something we can take care of on the server?

da1nerd commented 6 years ago

@mondele yes it appears the file names may have been changed on the server. This is definitely something that could be fixed on the server.

jag3773 commented 6 years ago

@neutrinog What is the zip file that tS is looking for?

mondele commented 6 years ago

It appears to be pulled in printer.js. The file downloaded is called obs-images.zip

var _ = require('lodash'), fs = require('fs'), path = require('path'), utils = require('../js/lib/utils'), AdmZip = require('adm-zip'), https = require('https'), mkdirp = require('mkdirp'), os = require('os'), princePackager = require('../js/prince-packager'), Prince = require('prince');

function PrintManager(configurator) {

var download = utils.download;
var srcDir = path.resolve(path.join(__dirname, '..'));
var imageRoot = path.join(configurator.getValue('rootdir'), 'images');
var imagePath = path.join(imageRoot, 'obs');
var zipPath = path.join(imageRoot, 'obs-images.zip');
var server = "https://api.unfoldingword.org/";
var url = server + 'obs/jpg/1/en/obs-images-360px.zip';

John Wood john_wood@wycliffeassociates.org mailto:john_wood@wycliffeassociates.org

MAST Help Desk Supervisor @jwood on #slack archistratus on

On Mar 14, 2018, at 9:06 AM, Jesse Griffin notifications@github.com wrote:

@neutrinog https://github.com/neutrinog What is the zip file that tS is looking for?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/unfoldingWord-dev/ts-desktop/issues/1212#issuecomment-373013861, or mute the thread https://github.com/notifications/unsubscribe-auth/AYSeiFoG9NtqLvwwGQM-iB6KxqAqbtUFks5teRXagaJpZM4Q4H3H.

da1nerd commented 6 years ago

@jag3773 the zip has images used for printing.