Skip to content

Commit 86e4a7e

Browse files
committed
remove wrong header licence, fix synthax error preventing import
1 parent 8f0ddc8 commit 86e4a7e

File tree

1 file changed

+7
-33
lines changed

1 file changed

+7
-33
lines changed

kivy/core/image/img_pdf.py

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,9 @@
1-
#-*- coding: utf-8 -*-
2-
#
3-
# this program is free software; you can redistribute it and/or modify
4-
# it under the terms of the GNU General Public License as published by
5-
# the Free Software Foundation; either version 2 of the License, or
6-
# (at your option) any later version.
7-
#
8-
# this program is distributed in the hope that it will be useful,
9-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11-
# GNU General Public License for more details.
12-
#
13-
# You should have received a copy of the GNU General Public License
14-
# if not, write to the Free Software
15-
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16-
#
17-
# The Graphics Interchange Format(c) is the Copyright property of
18-
# CompuServe Incorporated. GIF(sm) is a Service Mark property of
19-
# CompuServe Incorporated.
20-
#
21-
# The unisys/lzw patent has expired, yes. If anyone puts another patent
22-
# over this code, you must *burn* this file.
23-
24-
25-
#TODO issues to fix
26-
#optimize for speed #partially done# a lot of room for improvementd
27-
import struct
28-
from array import array
29-
import math
1+
'''
2+
PDF: PDF image loader
3+
'''
304

315
from kivy.logger import Logger
32-
from . import ImageLoaderBase, ImageData, ImageLoader
6+
from kivy.core.image import ImageLoaderBase, ImageLoader
337

348
Debug = False
359

@@ -39,9 +13,9 @@
3913
class ImageLoaderPDF(ImageLoaderBase):
4014
'''Image loader for PDF'''
4115

42-
def __init__(self, page=0, **kwargs):
16+
def __init__(self, page=0, filename=None, **kwargs):
4317
self.page = page
44-
super(ImageLoaderPDF, self).__init__(**kwargs)
18+
super(ImageLoaderPDF, self).__init__(filename, **kwargs)
4519

4620
@staticmethod
4721
def extensions():
@@ -67,7 +41,6 @@ def load(self, filename):
6741
#blobpng.data
6842

6943
im = PILImage.frombuffer('rgb', len(blobpng.data), blobpng.data)
70-
7144

7245
except:
7346
Logger.warning('Image: Unable to load image <%s>' % filename)
@@ -76,3 +49,4 @@ def load(self, filename):
7649
return list(self._img_read(im))
7750

7851
ImageLoader.register(ImageLoaderPDF)
52+
print "PDF loader registered!"

0 commit comments

Comments
 (0)