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

Camera and GPIO error after a while #197

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update PictureDimensions.py
added if clause for enabling single pictures
websta911 authored Nov 7, 2019
commit cc3aceaaf55f7ffdcfabe935e5aa96370f98381f
28 changes: 16 additions & 12 deletions photobooth/camera/PictureDimensions.py
Original file line number Diff line number Diff line change
@@ -78,19 +78,23 @@ def computeThumbnailDimensions(self):

self._thumb_offsets = []
#websta changedfrom thumbs
for i in range(self.numPictures[0] * self.numPictures[1]):
pos = (i % self.numPictures[0], i // self.numPictures[0])
#self._thumb_offsets.append(tuple(border[j] + (pos[j] + 1) * thumb_dist[j] + pos[j] * self.thumbnailSize[j] for j in range(2)))
# websta: changed to calculate from center of image so the spacing is horizontally and vertically equal
thumb_offs = []
for j in range(2):
if pos[j] < 1 :
thumb_offs.append(self.outputSize[j]//2 - self.thumbnailSize[j] - (thumb_dist[1] // 2))
else :
thumb_offs.append(self.outputSize[j]//2 + (thumb_dist[1] // 2))

self._thumb_offsets.append(tuple(thumb_offs[j]
if (self.numPictures[0] * self.numPictures[1]) > 1: #for mor than one picture
for i in range(self.numPictures[0] * self.numPictures[1]):
pos = (i % self.numPictures[0], i // self.numPictures[0])
#self._thumb_offsets.append(tuple(border[j] + (pos[j] + 1) * thumb_dist[j] + pos[j] * self.thumbnailSize[j] for j in range(2)))
# websta: changed to calculate from center of image so the spacing is horizontally and vertically equal
thumb_offs = []
for j in range(2):
if pos[j] < 1 :
thumb_offs.append(self.outputSize[j]//2 - self.thumbnailSize[j] - (thumb_dist[1] // 2))
else :
thumb_offs.append(self.outputSize[j]//2 + (thumb_dist[1] // 2))

self._thumb_offsets.append(tuple(thumb_offs[j]
for j in range(2)))
else: # if just one picture center the picture
self._thumb_offsets.append(tuple((self.outputSize[j]//2 - self.thumbnailSize[j]//2)
for j in range(2)))

logging.debug(('Assembled picture will contain {} ({}x{}) pictures '
'in positions {}').format(self.totalNumPictures,