Imagejpeg返回false但文件存在

时间:2017-06-02 08:49:22

标签: php wordpress

昨天我得到了一个输出import React, {Component} from 'react'; import {Image, Platform, StatusBar, ListView, TouchableHighlight} from 'react-native'; import {connect} from 'react-redux'; import {Actions} from 'react-native-router-flux'; import { Container, Content, Text, Item, Input, Button, Icon, View, Left, Right, Header, Body, Title, Spinner, Animated } from 'native-base'; import styles from './styles'; import * as competition from '../../../services/competition'; class ContentLoaded extends Component { render() { return ( <Text>Hello {this.props.name}!</Text> ); } } class Competition extends Component { constructor(props) { super(props); this.pressRow = this.pressRow.bind(this); this.state = { dataSource: new ListView.DataSource({ rowHasChanged: (row1, row2) => row1 !== row2, }), loaded: false, }; this.fetchData(); } /** * Cherche les competitions */ fetchData = function() { competition.getAll() .then((data) => { console.log(data); this.setState({ dataSource: this.state.dataSource.cloneWithRows(data), loaded: true, }); }) .catch((exception) => { console.log('competition controller 47', exception); }); } /** * Click sur une competiotn * @param data */ pressRow = (data, rowId) => { console.log(data); console.log(rowId); } /** * render d'une ligne * @param data * @returns {XML} */ renderRow(data, rowId){ return ( //<TouchableHighlight key={rowID} style={styles.lstView} onPress={()=> this.pressRow(rowId)}> <Button style={styles.lstView} onPress={()=> this.pressRow(data, rowId)}> <Image style={styles.lstPicto} /> <Text style={styles.lstText}>{data.name}</Text> <Icon name="angle-right" right style={styles.lstIcon} /> </Button> //</TouchableHighlight> ) } /** * Affichage conditionnek * @returns {XML} * @constructor */ ContentLoaded () { if (!this.state.loaded) { return <Text> Loading movies... </Text> } return <ListView dataSource={this.state.dataSource} renderRow = {this.renderRow.bind(this)} ></ListView> } /** * Render * @returns {XML} */ render() { return ( <Container style={styles.container}> <Header style={styles.header}> <Left> <Button transparent onPress={() => Actions.pop()}> <Icon active name="angle-left"/> </Button> </Left> <Body> <Title>Choisir un championnat</Title> </Body> <Right></Right> </Header> <View style={{flex: 1}}> {!this.state.loaded ? ( <Spinner size="small" color="#000000" /> ) : ( <ListView dataSource={this.state.dataSource} renderRow = {this.renderRow.bind(this)} ></ListView> )} </View> </Container> ) } } export default connect()(Competition); (虽然我没有设置标题但是不可读的字符)但今天没有。我唯一可以改变的是在服务器上启用特殊权限。知道还有什么可以影响它吗?以下代码的输出是:

imagejpg()

如果The file exists Imagejpeg: FALSE Imagejpeg: FALSE The file is writable ,则输出相同。

代码:

$filename = $URL

1 个答案:

答案 0 :(得分:0)

图像需要首先通过Imagescreatefromjpeg功能:

 $filename = imagecreatefromjpeg($_SERVER['DOCUMENT_ROOT'] . "/wordpress/wp-content/themes/mytheme/images/thumbnails/sb1778/1.jpg");