Ajuda com upload de imagem
09/02/2022
0
Boa tarde pessoal, estou tendo dificuldades na hora de fazer upload de imagens, preciso que as imagens carregadas sempre fiquem no mesmo tamanho como por exemplo 640X480 px da maneira que uso hoje consigo fazer o upload porém na hora de exibir elas ficam cortadas.
se puderem me ajudar desde ja agradeço
segue codigo php que estou usando para upload das imagens a meu banco de dados.
<script src="<?php echo base_url();?>/assets/js/layout_types/image.js"></script>
<div id="layout_image">
<p>
<div class="fileupload center fileupload-<?php echo (isset($layout_data) ? 'exists' : 'new'); ?>" data-provides="fileupload">
<div class="fileupload-new thumbnail" style="width: 400px; height: 300px;"><img src="<?php echo base_url() ?>assets/img/no-image.gif" /></div>
<div class="fileupload-preview fileupload-exists thumbnail" style="max-width: 400px; max-height: 400px; line-height: 20px;">
<?php if(isset($layout_data)) : ?><img src="<?php echo base_url().'files/'.$layout_data['assets'][0]; ?>" style="max-height: 200px; max-height:150px;" /><?php endif ?>
</div>
<div>
<span class="btn btn-file"><span class="fileupload-new" data-i18n="[html]layout_types_image.select_image">Selecione a imagem</span><span class="fileupload-exists" data-i18n="[html]layout_types_image.change_image">Change</span><input type="file" id="image-file" name="image-file" <?php echo (isset($layout_data) ? '' : 'required') ?> /></span>
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload" data-i18n="[html]layout_types_image.remove_image">Remover</a>
</div>
</div>
</p>
</div>
se puderem me ajudar desde ja agradeço
segue codigo php que estou usando para upload das imagens a meu banco de dados.
<script src="<?php echo base_url();?>/assets/js/layout_types/image.js"></script>
<div id="layout_image">
<p>
<div class="fileupload center fileupload-<?php echo (isset($layout_data) ? 'exists' : 'new'); ?>" data-provides="fileupload">
<div class="fileupload-new thumbnail" style="width: 400px; height: 300px;"><img src="<?php echo base_url() ?>assets/img/no-image.gif" /></div>
<div class="fileupload-preview fileupload-exists thumbnail" style="max-width: 400px; max-height: 400px; line-height: 20px;">
<?php if(isset($layout_data)) : ?><img src="<?php echo base_url().'files/'.$layout_data['assets'][0]; ?>" style="max-height: 200px; max-height:150px;" /><?php endif ?>
</div>
<div>
<span class="btn btn-file"><span class="fileupload-new" data-i18n="[html]layout_types_image.select_image">Selecione a imagem</span><span class="fileupload-exists" data-i18n="[html]layout_types_image.change_image">Change</span><input type="file" id="image-file" name="image-file" <?php echo (isset($layout_data) ? '' : 'required') ?> /></span>
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload" data-i18n="[html]layout_types_image.remove_image">Remover</a>
</div>
</div>
</p>
</div>
Paulo
Curtir tópico
+ 0
Responder
Clique aqui para fazer login e interagir na Comunidade :)