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

Story with image(s) embedded fails to save #1

Closed
ViciousSquid opened this issue Apr 5, 2024 · 2 comments
Closed

Story with image(s) embedded fails to save #1

ViciousSquid opened this issue Apr 5, 2024 · 2 comments
Assignees

Comments

@ViciousSquid
Copy link
Owner

Currently investigating - presumed problem in static/editor/editor.js

@ViciousSquid ViciousSquid self-assigned this Apr 5, 2024
@ViciousSquid
Copy link
Owner Author

Temporary fix has been implemented which just saves the story without trying to embed the images.
Actively investigating this.

ViciousSquid added a commit that referenced this issue Apr 6, 2024
Fixed issue #1 : Story with image(s) embedded fails to save
@ViciousSquid
Copy link
Owner Author

This was fixed by updating main.py Line 281:

@app.route('/images/<path:filename>')
def serve_image(filename):
    adventures = load_adventures()
    if current_adventure not in adventures:
        return redirect(url_for('main_menu'))

    adventure = adventures[current_adventure]
    with zipfile.ZipFile(adventure, 'r') as zip_ref:
        try:
            image_data = zip_ref.read(filename)
            response = make_response(image_data)
            response.headers.set('Content-Type', 'image/jpeg')  
            return response
        except KeyError:
            return redirect(url_for('main_menu'))

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

No branches or pull requests

1 participant