remove image width and height on full size

prophoto1

Joined: 2008-06-25
Posts: 10
Posted: Tue, 2013-08-27 21:37

How do I remove the image width and height attributes on the full size image page? I am working on creating a responsive copy of the wind theme. Thanks.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2013-08-27 21:49

The full sized image is a modal window with this bit of code:

    full_dims = [<?= $theme->item()->width ?>, <?= $theme->item()->height ?>];
    $(".g-fullsize-link").click(function() {
      $.gallery_show_full_size(<?= html::js_string($theme->item()->file_url()) ?>, full_dims[0], full_dims[1]);
      return false;
    

Perhaps I don't understand your question.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
prophoto1

Joined: 2008-06-25
Posts: 10
Posted: Tue, 2013-08-27 22:02

Nope, I asked the wrong question! I am guessing what I need to modify is below from photo.html.php

<div id="g-photo">
<?= $theme->resize_top($item) ?>
<? if (access::can("view_full", $item)): ?>
<a href="<?= $item->file_url() ?>" class="g-fullsize-link" title="<?= t("View full size")->for_html_attr() ?>">
<? endif ?>
<?= $item->resize_img(array("id" => "g-item-id-{$item->id}", "class" => "g-resize")) ?>
<? if (access::can("view_full", $item)): ?>
</a>
<? endif ?>
<?= $theme->resize_bottom($item) ?>
</div>

When output the image tag shows

<img width="700" height="466" alt="imagename" src="/var/resizes/folder/imagename.jpg?m=1376612491" class="g-resize" id="g-item-id-24909">

I'd like it to only show this:

<img alt="imagename" src="/var/resizes/folder/imagename.jpg?m=1376612491" class="g-resize" id="g-item-id-24909">

So I can control image sizes in CSS and scale down.

 
prophoto1

Joined: 2008-06-25
Posts: 10
Posted: Tue, 2013-08-27 23:32

As soon as I hit submit on that comment I tried this and it does what I wanted, preventing the image from being shown disproportionately.

#g-photo img {width:auto;height:auto;max-width:100%;}

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2013-08-27 23:12

$item->resize_img
The resize_img function returns the height and width. You would have to create a new function or do what you have done with CSS or you could replace the image with jquery as well.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Fri, 2014-03-07 02:04

Hi Prophoto 1.

Any news on your responsive theme ?

I am not a developer but would be happy to test it if you're still working on it..

------
Gallery 3 URL = http://www.coquille.org/gallery
Version: 3.0.2 (Coollanta)
Operating system: Linux 2.6.18-194.32.1.el5
Apache: Apache/2.2.3 (Red Hat)
PHP: 5.2.6
MySQL: 5.0.77
Server load: 1.31 1.58 1.53
Graphics toolkit: gd
-------