Skip to content

Using 'raw' without using 'save' gives no output #8

Description

@sharifanani

I think the title explains it all.

If I try to use .raw to server an SVG barcode without using .save first, I get an empty output...

Example:
Trying to serve this in my django project:

class APIBarcode(View):

    def get(self, request, *args, **kwargs):
        uuid = request.GET.get('uuid')
        C39 = barcode.get_barcode_class('code39')
        toserve = C39(uuid)
        toserve.save('c39code')
        return HttpResponse(toserve.raw, content_type="image/svg+xml")

Gives the following output:
image

But serving this:

class APIBarcode(View):

    def get(self, request, *args, **kwargs):
        uuid = request.GET.get('uuid')
        C39 = barcode.get_barcode_class('code39')
        toserve = C39(uuid)
        # toserve.save('c39code')
        return HttpResponse(toserve.raw, content_type="image/svg+xml")

Gives the following output:

image

If someone can point me to where I should be looking I would gladly attempt to fix it!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions