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

Display.py opens non-existing simplecv.png #466

Closed
hadzibanov-kostadin opened this issue Apr 23, 2013 · 9 comments
Closed

Display.py opens non-existing simplecv.png #466

hadzibanov-kostadin opened this issue Apr 23, 2013 · 9 comments

Comments

@hadzibanov-kostadin
Copy link
Contributor

I had an issue when setting up a display or running the show() method on an Image. The display class tries to open "simplecv.png" when initialising even if there is no "sampleimages" folder. I downloaded SimpleCV from SourceForge and the Ubuntu store, which hosted the version without sample images, however I noticed the faulty code is the same in the Github repository. Should I try and make a fix?

Here is the stack trace:


SimpleCV:9> display()
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
/usr/lib/pymodules/python2.7/SimpleCV/Shell/Shell.pyc in ()
----> 1 display()

NameError: name 'display' is not defined

SimpleCV:10> disp=Display()
---------------------------------------------------------------------------
IOError                                   Traceback (most recent call last)
/usr/lib/pymodules/python2.7/SimpleCV/Shell/Shell.pyc in ()
----> 1 disp=Display()

/usr/lib/pymodules/python2.7/SimpleCV/Display.pyc in __init__(self, resolution, flags, title, displaytype, headless)
    156         if not displaytype == 'notebook':
    157             self.screen = pg.display.set_mode(resolution, flags)
--> 158         scvLogo = SimpleCV.Image("simplecv").scale(32,32)
    159         pg.display.set_icon(scvLogo.getPGSurface())
    160         if flags != pg.FULLSCREEN and flags != pg.NOFRAME:

/usr/lib/pymodules/python2.7/SimpleCV/ImageClass.pyc in __init__(self, source, camera, colorSpace, verbose, sample, cv2image)
    785                     self._bitmap = cv.LoadImage(self.filename, iscolor=cv.CV_LOAD_IMAGE_COLOR)
    786                 except:
--> 787                     self._pil = pil.open(self.filename).convert("RGB")
    788                     self._bitmap = cv.CreateImageHeader(self._pil.size, cv.IPL_DEPTH_8U, 3)
    789                     cv.SetData(self._bitmap, self._pil.tostring())

/usr/lib/python2.7/dist-packages/PIL/Image.pyc in open(fp, mode)
   1950         import __builtin__
   1951         filename = fp
-> 1952         fp = __builtin__.open(fp, "rb")
   1953     else:
   1954         filename = ""

IOError: [Errno 2] No such file or directory: '/usr/lib/pymodules/python2.7/SimpleCV/sampleimages/simplecv.png'
@jayrambhia
Copy link
Contributor

This issue has already been resolved. #213

@hadzibanov-kostadin
Copy link
Contributor Author

I thought the developers wanted the sample images and tests to be opt-outs.
If I understood the code right, this is the Icon for the window, so if the sample images are optional, maybe it would make more sense to reside in a separate permanent folder, or at least the Display class to check if the file exists and possibly leave it empty if it doesn't.

@kscottz
Copy link
Contributor

kscottz commented Apr 24, 2013

So you blew away the samples folder? That was the root of the issue?

@hadzibanov-kostadin
Copy link
Contributor Author

No, this issue happens when there is no sampleimages folder (which was the case with the Ubuntu store and SourceForge versions)

Sorry if I was unclear.

@xamox
Copy link
Contributor

xamox commented Apr 24, 2013

@hadzibanov-kostadin Ubuntu Store version? What version of Ubuntu are you on?

@hadzibanov-kostadin
Copy link
Contributor Author

Ubuntu 12.04 LTS

@xamox
Copy link
Contributor

xamox commented Apr 25, 2013

Did you install from the .deb package?

@hadzibanov-kostadin
Copy link
Contributor Author

Yes, the .deb package form SourceForge

@kscottz kscottz closed this as completed Apr 26, 2013
@sly74fr
Copy link

sly74fr commented Jul 1, 2016

Still the same from Ubuntu 14.04LTS !!

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

5 participants