1
0
mirror of https://github.com/ToxicCrack/PrintABrick.git synced 2025-05-20 06:00:08 -07:00

Move model images folder

This commit is contained in:
David Hübner 2017-04-21 02:24:40 +02:00
parent 2a02cd19ef
commit bd4f21d102
3 changed files with 13 additions and 10 deletions

View File

@ -3,7 +3,10 @@
<div class="ui bordered fluid image"> <div class="ui bordered fluid image">
<a href="{{ url('model_detail', {'number': model.number})}}"> <a href="{{ url('model_detail', {'number': model.number})}}">
<div class="image"> <div class="image">
<img src="{{ asset('/ldraw/images/'~model.number~'.png') | imagine_filter('model_min') }}" data-src="{{ asset('/ldraw/images/'~model.number~'.png') | imagine_filter('model_min') }}" class="transition visible"> <img src="{{ asset('/images/-1/'~model.number~'.png') | imagine_filter('model_min') }}" data-src="{{ asset('/ldraw/images/-1/'~model.number~'.png') | imagine_filter('model_min') }}" class="transition visible">
{#<div class="image load">#}
{#<img src="{{ model.number|partImage|imagine_filter('rebrickable_part_min') }}" data-src="{{ model.number|partImage|imagine_filter('rebrickable_part_min') }}" class="transition visible">#}
{#</div>#}
</div> </div>
<div class="ui bottom attached label {% if model.parts|length == 0 %}black{% endif %}">{{ model.number }}</div> <div class="ui bottom attached label {% if model.parts|length == 0 %}black{% endif %}">{{ model.number }}</div>
</a> </a>

View File

@ -11,7 +11,7 @@
<div class="ui grid"> <div class="ui grid">
<div class="column ten wide"> <div class="column ten wide">
<div id="model-viewer" class="model-container"> <div id="model-viewer" class="model-container">
<img src="{{ asset('ldraw/images/'~model.number~'.png') | imagine_filter('model_large')}}"> <img src="{{ asset('/images/-1/'~model.number~'.png') | imagine_filter('model_large')}}">
</div> </div>
</div> </div>
<div class="column six wide"> <div class="column six wide">

View File

@ -58,11 +58,11 @@ class LDViewService
*/ */
public function datToStl($file, $rewrite = false) public function datToStl($file, $rewrite = false)
{ {
if (!$this->mediaFilesystem->has('ldraw'.DIRECTORY_SEPARATOR.'models')) { if (!$this->mediaFilesystem->has('models')) {
$this->mediaFilesystem->createDir('ldraw'.DIRECTORY_SEPARATOR.'models'); $this->mediaFilesystem->createDir('models');
} }
$newFile = 'ldraw'.DIRECTORY_SEPARATOR.'models'.DIRECTORY_SEPARATOR.basename($file, '.dat').'.stl'; $newFile = 'models'.DIRECTORY_SEPARATOR.basename($file, '.dat').'.stl';
if (!$this->mediaFilesystem->has($newFile) || $rewrite) { if (!$this->mediaFilesystem->has($newFile) || $rewrite) {
$this->runLDView([ $this->runLDView([
@ -70,7 +70,7 @@ class LDViewService
'-LDrawDir='.$this->ldrawLibraryContext->getAdapter()->getPathPrefix(), '-LDrawDir='.$this->ldrawLibraryContext->getAdapter()->getPathPrefix(),
'-ExportFiles=1', '-ExportFiles=1',
'-ExportSuffix=.stl', '-ExportSuffix=.stl',
'-ExportsDir='.$this->mediaFilesystem->getAdapter()->getPathPrefix().'ldraw'.DIRECTORY_SEPARATOR.'models', '-ExportsDir='.$this->mediaFilesystem->getAdapter()->getPathPrefix().'models',
]); ]);
// Check if file created successfully // Check if file created successfully
@ -96,11 +96,11 @@ class LDViewService
*/ */
public function datToPng($file, $rewrite = false) public function datToPng($file, $rewrite = false)
{ {
if (!$this->mediaFilesystem->has('ldraw'.DIRECTORY_SEPARATOR.'images')) { if (!$this->mediaFilesystem->has('images')) {
$this->mediaFilesystem->createDir('ldraw'.DIRECTORY_SEPARATOR.'images'); $this->mediaFilesystem->createDir('images');
} }
$newFile = 'ldraw'.DIRECTORY_SEPARATOR.'images'.DIRECTORY_SEPARATOR.basename($file, '.dat').'.png'; $newFile = 'images'.DIRECTORY_SEPARATOR.basename($file, '.dat').'.png';
if (!$this->mediaFilesystem->has($newFile) || $this->rewrite) { if (!$this->mediaFilesystem->has($newFile) || $this->rewrite) {
$this->runLDView([ $this->runLDView([
@ -118,7 +118,7 @@ class LDViewService
'-SaveWidth=800', '-SaveWidth=800',
'-CurveQuality=12', '-CurveQuality=12',
'-DefaultLatLong=45,40', '-DefaultLatLong=45,40',
'-SaveDir='.$this->mediaFilesystem->getAdapter()->getPathPrefix().'ldraw'.DIRECTORY_SEPARATOR.'images', '-SaveDir='.$this->mediaFilesystem->getAdapter()->getPathPrefix().'images',
'-SaveSnapshots=1', '-SaveSnapshots=1',
]); ]);