Commit 077f0f0
committed
Name an image file whose path does not name itself
`getExtension()` asks `pathinfo()` and nothing else, so a path carrying no extension answers with
an empty string. `getIndexedFilename()` then builds `logo1.` -- a media part ending in a bare dot,
which the writers register under no content type at all.
The bytes know what the name does not: `getimagesizefromstring()` already backs `getMimeType()` a
few lines above, and its type constant converts straight to an extension. The lookup happens only
when `pathinfo()` came back empty and the file is there to be read, so a path with an extension
costs exactly what it did before -- no file access.
An extensionless SVG stays extensionless: it has no pixel dimensions for `getimagesize()` to
report, and there is nothing else in the file this decision could rest on.1 parent c01ebbd commit 077f0f0
3 files changed
Lines changed: 25 additions & 1 deletion
File tree
- docs/changes
- src/PhpPresentation/Shape/Drawing
- tests/PhpPresentation/Tests/Shape/Drawing
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
79 | 87 | | |
80 | 88 | | |
81 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
58 | 73 | | |
59 | 74 | | |
60 | 75 | | |
| |||
0 commit comments