mirror of
https://code.castopod.org/adaures/castopod
synced 2025-06-06 18:31:05 +00:00
fix(images): set default mimetype if none is specified when getting size info
This commit is contained in:
parent
17fb29b209
commit
6e4acc64ad
@ -33,14 +33,16 @@ class Image extends BaseMedia
|
|||||||
{
|
{
|
||||||
helper('media');
|
helper('media');
|
||||||
|
|
||||||
$extension = $this->file_extension;
|
|
||||||
$mimetype = $this->file_mimetype;
|
|
||||||
foreach ($this->sizes as $name => $size) {
|
foreach ($this->sizes as $name => $size) {
|
||||||
if (array_key_exists('extension', $size)) {
|
if (array_key_exists('extension', $size)) {
|
||||||
$extension = $size['extension'];
|
$extension = $size['extension'];
|
||||||
|
} else {
|
||||||
|
$extension = $this->file_extension;
|
||||||
}
|
}
|
||||||
if (array_key_exists('mimetype', $size)) {
|
if (array_key_exists('mimetype', $size)) {
|
||||||
$mimetype = $size['mimetype'];
|
$mimetype = $size['mimetype'];
|
||||||
|
} else {
|
||||||
|
$mimetype = $this->file_mimetype;
|
||||||
}
|
}
|
||||||
$this->{$name . '_path'} = $this->file_directory . '/' . $this->file_name . '_' . $name . '.' . $extension;
|
$this->{$name . '_path'} = $this->file_directory . '/' . $this->file_name . '_' . $name . '.' . $extension;
|
||||||
$this->{$name . '_url'} = media_base_url($this->{$name . '_path'});
|
$this->{$name . '_url'} = media_base_url($this->{$name . '_path'});
|
||||||
|
@ -30,9 +30,7 @@ if (! function_exists('write_audio_file_tags')) {
|
|||||||
$tagwriter->tagformats = ['id3v2.4'];
|
$tagwriter->tagformats = ['id3v2.4'];
|
||||||
$tagwriter->tag_encoding = $TextEncoding;
|
$tagwriter->tag_encoding = $TextEncoding;
|
||||||
|
|
||||||
$cover = new File(media_path($episode->cover->id3_path));
|
$APICdata = file_get_contents(media_path($episode->cover->id3_path));
|
||||||
|
|
||||||
$APICdata = file_get_contents($cover->getRealPath());
|
|
||||||
|
|
||||||
// TODO: variables used for podcast specific tags
|
// TODO: variables used for podcast specific tags
|
||||||
// $podcastUrl = $episode->podcast->link;
|
// $podcastUrl = $episode->podcast->link;
|
||||||
@ -73,7 +71,7 @@ if (! function_exists('write_audio_file_tags')) {
|
|||||||
'picturetypeid' => 2,
|
'picturetypeid' => 2,
|
||||||
'data' => $APICdata,
|
'data' => $APICdata,
|
||||||
'description' => 'cover',
|
'description' => 'cover',
|
||||||
'mime' => $cover->getMimeType(),
|
'mime' => $episode->cover->file_mimetype,
|
||||||
];
|
];
|
||||||
|
|
||||||
$tagwriter->tag_data = $TagData;
|
$tagwriter->tag_data = $TagData;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user