René's URL Explorer Experiment


Title: add_picture · Issue #187 · python-openxml/python-docx · GitHub

Open Graph Title: add_picture · Issue #187 · python-openxml/python-docx

X Title: add_picture · Issue #187 · python-openxml/python-docx

Description: I am new to python and I am having issues witth add_picture my code is simple from docx import Document from docx.shared import Inches document = Document() document.add_heading('Document Title', 0) document.add_picture('IMG_2063.jpg') d...

Open Graph Description: I am new to python and I am having issues witth add_picture my code is simple from docx import Document from docx.shared import Inches document = Document() document.add_heading('Document Title', 0...

X Description: I am new to python and I am having issues witth add_picture my code is simple from docx import Document from docx.shared import Inches document = Document() document.add_heading('Document Title...

Opengraph URL: https://github.com/python-openxml/python-docx/issues/187

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"add_picture","articleBody":"I am new to python and I am having issues witth add_picture\nmy code is simple \n\nfrom docx import Document\nfrom docx.shared import Inches\ndocument = Document()\ndocument.add_heading('Document Title', 0)\ndocument.add_picture('IMG_2063.jpg')\ndocument.add_page_break()\ndocument.save('demo.docx')\n\nfor some reason it was working and now i get a long string of errors. i cant seem to see what i am doing wrong. if nothting do i need to reinstall?\n\nhere is the error\nE:\\calculations\\temp\u003edoc2.py\nTraceback (most recent call last):\n  File \"E:\\calculations\\temp\\doc2.py\", line 18, in \u003cmodule\u003e\n    document.add_picture('IMG_2063.jpg')\n  File \"C:\\Python27\\ArcGISx6410.2\\lib\\site-packages\\docx\\document.py\", line 79, in add_picture\n    return run.add_picture(image_path_or_stream, width, height)\n  File \"C:\\Python27\\ArcGISx6410.2\\lib\\site-packages\\docx\\text\\run.py\", line 62, in add_picture\n    inline = self.part.new_pic_inline(image_path_or_stream, width, height)\n  File \"C:\\Python27\\ArcGISx6410.2\\lib\\site-packages\\docx\\parts\\document.py\", line 91, in new_pic_inline\n    rId, image = self.get_or_add_image(image_descriptor)\n  File \"C:\\Python27\\ArcGISx6410.2\\lib\\site-packages\\docx\\parts\\document.py\", line 54, in get_or_add_image\n    image_descriptor\n  File \"C:\\Python27\\ArcGISx6410.2\\lib\\site-packages\\docx\\package.py\", line 76, in get_or_add_image_part\n    image = Image.from_file(image_descriptor)\n  File \"C:\\Python27\\ArcGISx6410.2\\lib\\site-packages\\docx\\image\\image.py\", line 55, in from_file\n    return cls._from_stream(stream, blob, filename)\n  File \"C:\\Python27\\ArcGISx6410.2\\lib\\site-packages\\docx\\image\\image.py\", line 176, in _from_stream\n    image_header = _ImageHeaderFactory(stream)\n  File \"C:\\Python27\\ArcGISx6410.2\\lib\\site-packages\\docx\\image\\image.py\", line 198, in _ImageHeaderFactory\n    return cls.from_stream(stream)\n  File \"C:\\Python27\\ArcGISx6410.2\\lib\\site-packages\\docx\\image\\jpeg.py\", line 47, in from_stream\n    markers = _JfifMarkers.from_stream(stream)\n  File \"C:\\Python27\\ArcGISx6410.2\\lib\\site-packages\\docx\\image\\jpeg.py\", line 111, in from_stream\n    for marker in marker_parser.iter_markers():\n  File \"C:\\Python27\\ArcGISx6410.2\\lib\\site-packages\\docx\\image\\jpeg.py\", line 177, in iter_markers\n    marker_code, self._stream, segment_offset\n  File \"C:\\Python27\\ArcGISx6410.2\\lib\\site-packages\\docx\\image\\jpeg.py\", line 271, in _MarkerFactory\n    return marker_cls.from_stream(stream, marker_code, offset)\n  File \"C:\\Python27\\ArcGISx6410.2\\lib\\site-packages\\docx\\image\\jpeg.py\", line 413, in from_stream\n    tiff = cls._tiff_from_exif_segment(stream, offset, segment_length)\n  File \"C:\\Python27\\ArcGISx6410.2\\lib\\site-packages\\docx\\image\\jpeg.py\", line 455, in _tiff_from_exif_segment\n    return Tiff.from_stream(substream)\n  File \"C:\\Python27\\ArcGISx6410.2\\lib\\site-packages\\docx\\image\\tiff.py\", line 36, in from_stream\n    parser = _TiffParser.parse(stream)\n  File \"C:\\Python27\\ArcGISx6410.2\\lib\\site-packages\\docx\\image\\tiff.py\", line 63, in parse\n    ifd_entries = _IfdEntries.from_stream(stream_rdr, ifd0_offset)\n  File \"C:\\Python27\\ArcGISx6410.2\\lib\\site-packages\\docx\\image\\tiff.py\", line 176, in from_stream\n    entries = dict((e.tag, e.value) for e in ifd_parser.iter_entries())\n  File \"C:\\Python27\\ArcGISx6410.2\\lib\\site-packages\\docx\\image\\tiff.py\", line 176, in \u003cgenexpr\u003e\n    entries = dict((e.tag, e.value) for e in ifd_parser.iter_entries())\n  File \"C:\\Python27\\ArcGISx6410.2\\lib\\site-packages\\docx\\image\\tiff.py\", line 204, in iter_entries\n    ifd_entry = _IfdEntryFactory(self._stream_rdr, dir_entry_offset)\n  File \"C:\\Python27\\ArcGISx6410.2\\lib\\site-packages\\docx\\image\\tiff.py\", line 231, in _IfdEntryFactory\n    return entry_cls.from_stream(stream_rdr, offset)\n  File \"C:\\Python27\\ArcGISx6410.2\\lib\\site-packages\\docx\\image\\tiff.py\", line 256, in from_stream\n    stream_rdr, offset, value_count, value_offset\n  File \"C:\\Python27\\ArcGISx6410.2\\lib\\site-packages\\docx\\image\\tiff.py\", line 294, in _parse_value\n    return stream_rdr.read_str(value_count-1, value_offset)\n  File \"C:\\Python27\\ArcGISx6410.2\\lib\\site-packages\\docx\\image\\helpers.py\", line 70, in read_str\n    chars = self._unpack_item(struct, base, offset)\n  File \"C:\\Python27\\ArcGISx6410.2\\lib\\site-packages\\docx\\image\\helpers.py\", line 96, in _unpack_item\n    bytes_ = self._read_bytes(struct.size, base, offset)\n  File \"C:\\Python27\\ArcGISx6410.2\\lib\\site-packages\\docx\\image\\helpers.py\", line 88, in _read_bytes\n    raise UnexpectedEndOfFileError\ndocx.image.exceptions.UnexpectedEndOfFileError\n","author":{"url":"https://github.com/davelawrence3d","@type":"Person","name":"davelawrence3d"},"datePublished":"2015-06-15T19:43:10.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":14},"url":"https://github.com/187/python-docx/issues/187"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:211f3d6f-2602-3978-1502-0957925ae732
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8010:1F8597:17BD003:2010AB6:6972B11B
html-safe-nonce157b575ffa0db939edbbaefa2898b038b9fb5f5d8269899c481f7f010b1030b5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MDEwOjFGODU5NzoxN0JEMDAzOjIwMTBBQjY6Njk3MkIxMUIiLCJ2aXNpdG9yX2lkIjoiNjUwODk4NjM2MTY1Nzg3OTMyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacd9f9d57f3702aafaf2d391f9c93a16918846302521bfd77ecdbdaf88bd82150c
hovercard-subject-tagissue:88520648
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-openxml/python-docx/187/issue_layout
twitter:imagehttps://opengraph.githubassets.com/bb398d204923ad9a59948f480f3c5d9a23b7168365c93f8a8f0effb2baa5e1b5/python-openxml/python-docx/issues/187
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/bb398d204923ad9a59948f480f3c5d9a23b7168365c93f8a8f0effb2baa5e1b5/python-openxml/python-docx/issues/187
og:image:altI am new to python and I am having issues witth add_picture my code is simple from docx import Document from docx.shared import Inches document = Document() document.add_heading('Document Title', 0...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedavelawrence3d
hostnamegithub.com
expected-hostnamegithub.com
Noneae357919e9cc5fb635a01c9a2cc530478d3ac85f55090215eb70e1beca3385ac
turbo-cache-controlno-preview
go-importgithub.com/python-openxml/python-docx git https://github.com/python-openxml/python-docx.git
octolytics-dimension-user_id3403760
octolytics-dimension-user_loginpython-openxml
octolytics-dimension-repository_id13592924
octolytics-dimension-repository_nwopython-openxml/python-docx
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id13592924
octolytics-dimension-repository_network_root_nwopython-openxml/python-docx
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release625f1bd9f76a617a9c0729e2de91edb56b6ce42f
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/python-openxml/python-docx/issues/187#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-openxml%2Fpython-docx%2Fissues%2F187
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-openxml%2Fpython-docx%2Fissues%2F187
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python-openxml%2Fpython-docx
Reloadhttps://patch-diff.githubusercontent.com/python-openxml/python-docx/issues/187
Reloadhttps://patch-diff.githubusercontent.com/python-openxml/python-docx/issues/187
Reloadhttps://patch-diff.githubusercontent.com/python-openxml/python-docx/issues/187
python-openxml https://patch-diff.githubusercontent.com/python-openxml
python-docxhttps://patch-diff.githubusercontent.com/python-openxml/python-docx
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fpython-openxml%2Fpython-docx
Fork 1.3k https://patch-diff.githubusercontent.com/login?return_to=%2Fpython-openxml%2Fpython-docx
Star 5.4k https://patch-diff.githubusercontent.com/login?return_to=%2Fpython-openxml%2Fpython-docx
Code https://patch-diff.githubusercontent.com/python-openxml/python-docx
Issues 577 https://patch-diff.githubusercontent.com/python-openxml/python-docx/issues
Pull requests 124 https://patch-diff.githubusercontent.com/python-openxml/python-docx/pulls
Actions https://patch-diff.githubusercontent.com/python-openxml/python-docx/actions
Projects 0 https://patch-diff.githubusercontent.com/python-openxml/python-docx/projects
Wiki https://patch-diff.githubusercontent.com/python-openxml/python-docx/wiki
Security 0 https://patch-diff.githubusercontent.com/python-openxml/python-docx/security
Insights https://patch-diff.githubusercontent.com/python-openxml/python-docx/pulse
Code https://patch-diff.githubusercontent.com/python-openxml/python-docx
Issues https://patch-diff.githubusercontent.com/python-openxml/python-docx/issues
Pull requests https://patch-diff.githubusercontent.com/python-openxml/python-docx/pulls
Actions https://patch-diff.githubusercontent.com/python-openxml/python-docx/actions
Projects https://patch-diff.githubusercontent.com/python-openxml/python-docx/projects
Wiki https://patch-diff.githubusercontent.com/python-openxml/python-docx/wiki
Security https://patch-diff.githubusercontent.com/python-openxml/python-docx/security
Insights https://patch-diff.githubusercontent.com/python-openxml/python-docx/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/python-openxml/python-docx/issues/187
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/python-openxml/python-docx/issues/187
#1451https://github.com/python-openxml/python-docx/pull/1451
add_picturehttps://patch-diff.githubusercontent.com/python-openxml/python-docx/issues/187#top
#1451https://github.com/python-openxml/python-docx/pull/1451
imagehttps://github.com/python-openxml/python-docx/issues?q=state%3Aopen%20label%3A%22image%22
https://github.com/davelawrence3d
https://github.com/davelawrence3d
davelawrence3dhttps://github.com/davelawrence3d
on Jun 15, 2015https://github.com/python-openxml/python-docx/issues/187#issue-88520648
imagehttps://github.com/python-openxml/python-docx/issues?q=state%3Aopen%20label%3A%22image%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.