Title: Size parameter doesn't support omitting length or width · Issue #36 · python-thumbnails/python-thumbnails · GitHub
Open Graph Title: Size parameter doesn't support omitting length or width · Issue #36 · python-thumbnails/python-thumbnails
X Title: Size parameter doesn't support omitting length or width · Issue #36 · python-thumbnails/python-thumbnails
Description: According to the docs at https://python-thumbnails.readthedocs.io/en/latest/creating-thumbnails.html size – String with the wanted thumbnail size. On the form: 200x200, 200 or x200. But using the second or third forms causes an exception...
Open Graph Description: According to the docs at https://python-thumbnails.readthedocs.io/en/latest/creating-thumbnails.html size – String with the wanted thumbnail size. On the form: 200x200, 200 or x200. But using the s...
X Description: According to the docs at https://python-thumbnails.readthedocs.io/en/latest/creating-thumbnails.html size – String with the wanted thumbnail size. On the form: 200x200, 200 or x200. But using the s...
Opengraph URL: https://github.com/python-thumbnails/python-thumbnails/issues/36
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Size parameter doesn't support omitting length or width","articleBody":"According to the docs at https://python-thumbnails.readthedocs.io/en/latest/creating-thumbnails.html\r\n\r\n`size – String with the wanted thumbnail size. On the form: 200x200, 200 or x200.`\r\n\r\nBut using the second or third forms causes an exception:\r\n\r\n```\r\n\u003e\u003e\u003e get_thumbnail('d:\\\\temp\\\\test.jpg', '200x200', crop='center') \r\n\u003cthumbnails.images.Thumbnail object at 0x0000022108309B08\u003e\r\n\u003e\u003e\u003e get_thumbnail('d:\\\\temp\\\\test.jpg', '200x', crop='center') \r\nTraceback (most recent call last):\r\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\r\n File \"C:\\Users\\USER\\Envs\\cypress\\lib\\site-packages\\thumbnails\\__init__.py\", line 53, in get_thumbnail\r\n size = engine.parse_size(size)\r\n File \"C:\\Users\\USER\\Envs\\cypress\\lib\\site-packages\\thumbnails\\engines\\base.py\", line 183, in parse_size\r\n return int(size.split('x')[0]), int(size.split('x')[1])\r\nValueError: invalid literal for int() with base 10: ''\r\n\u003e\u003e\u003e get_thumbnail('d:\\\\temp\\\\test.jpg', 'x200', crop='center') \r\nTraceback (most recent call last):\r\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\r\n File \"C:\\Users\\USER\\Envs\\cypress\\lib\\site-packages\\thumbnails\\__init__.py\", line 54, in get_thumbnail\r\n thumbnail.image = engine.get_thumbnail(original, size, crop, options)\r\n File \"C:\\Users\\USER\\Envs\\cypress\\lib\\site-packages\\thumbnails\\engines\\base.py\", line 37, in get_thumbnail\r\n image = self.create(original, size, crop, options)\r\n File \"C:\\Users\\USER\\Envs\\cypress\\lib\\site-packages\\thumbnails\\engines\\base.py\", line 58, in create\r\n crop = self.parse_crop(crop, self.get_image_size(image), size)\r\n File \"C:\\Users\\USER\\Envs\\cypress\\lib\\site-packages\\thumbnails\\engines\\base.py\", line 209, in parse_crop\r\n x_offset = self.calculate_offset(x_crop, original_size[0], size[0])\r\n File \"C:\\Users\\USER\\Envs\\cypress\\lib\\site-packages\\thumbnails\\engines\\base.py\", line 226, in calculate_offset\r\n min(percent * original_length / 100.0, original_length - length / 2) - length / 2)\r\nTypeError: unsupported operand type(s) for /: 'NoneType' and 'int'\r\n```","author":{"url":"https://github.com/roytang","@type":"Person","name":"roytang"},"datePublished":"2020-09-20T20:35:46.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/36/python-thumbnails/issues/36"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d0d3cf97-a023-f9aa-ca3e-d9330a0fa37e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C2C0:992B3:6099E5:86F077:696A54B2 |
| html-safe-nonce | c9200d30a6678b4918d15f01cf0a5871f9e2f3bad64e8c7d76d43cbc2418b573 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMkMwOjk5MkIzOjYwOTlFNTo4NkYwNzc6Njk2QTU0QjIiLCJ2aXNpdG9yX2lkIjoiNDMwODMwMDEzNDY4MDc3NzkwNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9b7fa0c8a3a8278edf49032b46360ff0647eff7daa71ae788c56f6b584329fc1 |
| hovercard-subject-tag | issue:705181310 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-thumbnails/python-thumbnails/36/issue_layout |
| twitter:image | https://opengraph.githubassets.com/63e34d9e10240c0d60497af9b923b58d4d9300bb465cbfe3f81af96f1294d925/python-thumbnails/python-thumbnails/issues/36 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/63e34d9e10240c0d60497af9b923b58d4d9300bb465cbfe3f81af96f1294d925/python-thumbnails/python-thumbnails/issues/36 |
| og:image:alt | According to the docs at https://python-thumbnails.readthedocs.io/en/latest/creating-thumbnails.html size – String with the wanted thumbnail size. On the form: 200x200, 200 or x200. But using the s... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | roytang |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3f871c8e07f0ae1886fa8dac284166d28b09ad5bada6476fc10b674e489788ef |
| turbo-cache-control | no-preview |
| go-import | github.com/python-thumbnails/python-thumbnails git https://github.com/python-thumbnails/python-thumbnails.git |
| octolytics-dimension-user_id | 16475284 |
| octolytics-dimension-user_login | python-thumbnails |
| octolytics-dimension-repository_id | 32233986 |
| octolytics-dimension-repository_nwo | python-thumbnails/python-thumbnails |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 32233986 |
| octolytics-dimension-repository_network_root_nwo | python-thumbnails/python-thumbnails |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 63c426b30d262aba269ef14c40e3c817b384cd61 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width